Pack Your Bag explainer

It looks like I did what I was supposed to do in the solution box but it won’t let me move on

I was looking for help here bc I thought I did something wrong (I didn’t) and my problem was that I spelled mybackpack instead of myBackpack and banana instead of bananas. My reasoning is that spelling doesn’t really count as long as I keep it consistent, right? Is it grasshopper making me spell it like this or is it universal? Thanks

Hey there, you are correct that consistency is key. JavaScript requires exact spelling, so 'bananas' is not equal to 'Bananas'. Likewise, the variable mybackpack is not the same as myBackpack.

In this puzzle, Grasshopper is imposing the spelling restrictions, as we write the events that determine whether a puzzle is complete, or if specific feedback messages need to be shown. If our validation code is looking for myBackpack, but you have mybackpack, the variable will not be found.

In JavaScript, it is convention to use “camel case” when naming variables or functions. In camel case, the first word is not capitalized, but all subsequent words are. For example: myVariable rather than myvariable. This is why we require that you use myBackpack, as it is in keeping with JavaScript best practices.

You may see other case systems in other programming languages. Python, for example, uses “snake case”, which looks like my_variable.

im not sure what im doing wrongScreenshot_20190429-202654_Grasshopper

Hey there, I moved your post into this thread.

As for the code, change mybackpack to myBackpack, and the puzzle should complete.

Hope this helps!
Ben

Thanks lol I figured it out like a minute after lol and I was like waaa cant beleave i missed that but i learn from the mistake

1 Like

A post was merged into an existing topic: Get More Supplies explainer

I’m having an issue, not sure what I’m doing wrong

Hey there, it looks like there’s a typo in ‘equipment’. Try changing the ‘t’ to a ‘p’ and the puzzle should complete.

Yes, realized it shortly after I asked for help!
Thank you!

1 Like

Hello, I have problem. I can’t resolve this level. Here is my code:
Screenshot_20190601-082019|281x500

Check the spelling of the equipment property. There is an extra 'e' that should be removed.

–Frankie

Thanks you very much sir

1 Like

I can’t get past this level. I have the same thing as @Boba_the_fetts and still can’t get past.

Check the spelling of each property name, and also make sure your variable is named myBackpack. If that doesn’t solve the problem, please post a screenshot of your code and I can take a look at it.

Hope this helps!
Ben