Get More Supplies explainer


The aim of this puzzle: To update the objects values to store arrays [] rather than strings. The value 'bananas' stored inside the food property should be replaced with an array that lists two or more food items (i.e. two or more strings). The value 'map' stored inside the equipment property should be replaced with an array that lists two or more equipment items. And the value 'hat' stored inside the clothing property should be replaced with an array that lists two or more clothing items. In the end you’ll have three arrays inside the object myBackpack.
Review concepts: The achievements ‘Used a String’, ‘Created an Array’ and ‘Accessed a Property’s Value’ unlock the ability to complete this puzzle.
Review puzzles: Try taking another a look at the puzzles ‘Passphrase Generator’ and ‘Custom Colors’ to get an idea of how to replace a string and change an objects value — as well as how to create an array.
Sample code solution:
(Tap below to reveal)

Since this is part of the final topic of the fundamentals course and it is testing your knowledge, there is no sample solution code.

JavaScript Concepts: Object Expressions, Member Expressions, Calling Functions, Data Structures (arrays)
Grasshopper Concepts: print()

Get More Supplies
Get more equipment
Hell with code - get more supplies

Hi i’m a bit lost in this puzzle. Can someone please explain this puzzle? Thank you in advance


Hey @CluelessCoder,

Do you want to share a screenshot of they code you have so far — then I can give you some pointers on where to make changes?

H :slight_smile:


Thanks btw @Grasshopper_Heather


Hey @CluelessCoder,

Well you’re definitely not clueless, you’re just giving yourself extra work!

Rather than creating new variables to store arrays (like you have in var bananas = [.....], try instead to directly add the arrays inside the food, equipment and clothing properties, of the myBackpack object.

I’d suggest your reset your code (by tapping on the button with arrows in a circle). Then tap on the string in the food property (I think it’s 'bananas'), then tap on the array key. That will replace the string with an array. Inside your new array, add three new strings, so it’ll look something like food: ['bananas', 'nuts', 'energy bar'].

Then repeat that for equipment and clothing!

I hope this helps and you’re feeling a little less clueless.

H :slight_smile:


This is what you should be doing



How do you get them the stack instead of listing? I have this…


@Vivacia To allow for multiple strings spaced out on different lines, you have to first insert brackets [ ]. That lets the code know you’re using an array and an array allows you to have multiple strings as the value. So delete the string ‘apples, granola, chips’ and then look for the [ ] button to add an array. Then that will let you have them stacked like in Dennis’s screenshot.


Eu fiz o código, porém parece estar incompleto, pois não apareceu a mensagem de sucesso

Meu código ficou assim:

Se alguém puder me orientar agradeço


Já conseguir descobrir o erro!


¡Estoy feliz de que lo hayas resuelto! El código quería que cada artículo en una línea separada


Please help me what’s wrong in my code


I think that there is a bug or glitch on this section. I have completed it, but it will not or doesn’t acknowledge it. Please fix. Thank you


Hi @joestak,
What does your code look like? :slightly_smiling_face:


Hey @Kapil_Shalgar,

As of now, you have an array with a single string in it. (‘bananas, nuts, energy bar’)
For this assignment, you want to have an array with 3 strings in it. (‘bananas’, newLine ‘nuts’, newLine ‘energy bar’)
By having 3 different elements, your array (food) can access any of the 3 individually instead of having to call all of them at once every time it wants a single element.
Your equipment and clothing arrays have the same issue. Fixing them will be the solution to this puzzle.

Hope this helps! Feel free to reply if you’d like for me to go more in-depth. :smile:

Get more equipment

You just have to do like
Arrayvalue: [
This is the syntax to define array


I did not use separate lines, I just separated with comma. Thank you. The output looked okay, but was not.


Here your answer


Just be a simpler coder don’t make it complicated


Can somebody help with my code. I’m stuck