Pack Your Bag explainer


#122

Hey there! Try checking the spelling of equipment in the myBackpack object.

Thanks,
Ben


#123

My question is aboit. Pack your backback.


I have tried this with just bananas
I’ve printed out bananas, hat and map.
Every way I 've tried is incorrect.
What am I doing wrong?


#124

Your code should work if you remove the 1st line of code: var myBackpack = myBackpack;.

–Frankie


#125

It worked, Thank you! But, it says to create a variable myBackpack.
That was the line I removed.
I would of never guessed. Do you know why it says to create a variable
But the end result to get correct, you don’t use that code.


#126

There could be a mistake in the feedback – I’ll have to check.

In this puzzle, you do have to create a myBackpack variable using var myBackpack = ..., but the code you posted has that written twice. Once a variable is created, it doesn’t need to be created again. If you want to change an existing variable’s value, you just use myBackpack = ... without var or let.


let is a different kind of variable taught in Fundamentals II. Sometimes you can have multiple let myVariable = ... in your code. This is because each let only exists inside its own code block {}. So you can actually have different variables with the same name because they’re “trapped” in their own part of the code.

–Frankie


#127

I’ve used this code so many times and it’s still not letting me get past, I don’t underatand.


#128

If you share a screenshot of your code, I could take a look.

–Frankie


#129

See the thing that pisses me off about this puzzle is why is it that when i declare a variable it immidetly prompts me to add value to it. Why cant i leave it with no value ??.???