Invisible Man explainer

The aim of this puzzle: Add a property to an object.
Walkthrough of the solution: This puzzle involves adding a property to an object. An object is one of the fundamental data types in programming, and is used to store multiple pieces of data in a single variable.

For example, rather than having 3 separate variables:

var name = 'Josie';
var species = 'dog';
var age = 0.8;

1 single object could hold all of this related information:

var pet = {
  name: 'Josie',
  species: 'dog'
  age: 0.8

To access the data inside of an object, use dot notation: (There is also bracket notation, which looks like pet['name'], but this is not used in the Grasshopper app, and generally dot notation is preferred.)

In this puzzle, the object name starts with the properties first and middle. To complete the puzzle, add a last property to the object, and give it the string 'Ellison' as a value. When the code runs, this will print out 'Ralph Waldo Ellison', the author of the 1953 novel Invisible Man.

Sample code solution:
(Tap below to reveal)

var name = {
  first: 'Ralph ',
  middle: 'Waldo ',
  last: 'Ellison '
print(name.first + name.middle + name.last);

JavaScript Concepts: Arithmetic Operators (+ string concatenation), Assignments, Binary Expression (+), Code Block (object)
Grasshopper Concepts: print()

1 Like

How can I take a picture of hoppy grace


Take a screenshot :grinning:

1 Like

Thank You so much for The Help and I need Help with how I should Type it out

can i know how to e
remove that first and write there last?

1 Like