The aim of this puzzle: Change the drawBox color from nervous
to excited
.
Walkthrough of the solution: The object moods
contains pairs of moods and colors. To use the colors stored inside the moods
object, you use moods.theNameOfTheMood
. So, moods.nervous
will turn into 'orange'
. moods.curious
will turn into 'pink'
. To make a box that has the color of excitement, you use drawBox(moods.excited)
. That will create a cyan colored box.
Sample code solution:
(Tap below to reveal)
var moods = {
angry: 'red',
calm: 'blue',
cautious: 'yellow',
curious: 'pink',
excited: 'cyan',
happy: 'violet',
nervous: 'orange',
relaxed: 'indigo'
};
drawBox(moods.excited);
JavaScript Concepts: Code Block (object)
Grasshopper Concepts: drawBox()