Freecodecamp: I don't understand the instructions to "use strict";

Created on 3 Jul 2017  路  3Comments  路  Source: freeCodeCamp/freeCodeCamp

I put some comments in my code, but I'm not sure if this was correct, the challenge passed with/without the line at the top, but I'm not sure if I used it in the manner that you were hoping. Maybe clearer instructions if I used it incorrectly? Hard to say :) Keep up the good work though!

Challenge explore-problems-with-the-var-keyword has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

"use strict"; // I don't understand the instructions or if this is right.

let redNosedReindeer = "Rudolph";
let favorite = redNosedReindeer + " is Santa's favorite reindeer.";


Most helpful comment

It might be confusing for a beginner. There's no explanation as to what "use strict" does.
Also, the instructions say to use "let" but doesn't tell you to remove the other redNosedReindeer variable. Feels like the instructions could be clearer.

@freeCodeCamp/moderators Thoughts?

All 3 comments

It might be confusing for a beginner. There's no explanation as to what "use strict" does.
Also, the instructions say to use "let" but doesn't tell you to remove the other redNosedReindeer variable. Feels like the instructions could be clearer.

@freeCodeCamp/moderators Thoughts?

Some modern browsers require you to add "use strict"; to the top of your code before you can use the new features of ES6.

I would put "the new features of ES6, including let", so it's clearer that "use strict"; is connected to let.

Whatever error checking system fcc is using it mentions that use strict should be within function scope. Like this: function() {'use strict';}; So the first line of the function has use strict and the rest of the code comes after. That would mean the santa variables would have to go inside the function as well. Not really sure if that is what fcc wants though. Also for these activities check the errors, do some problem solving, and check google. That's what I had to do as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bagrounds picture bagrounds  路  3Comments

trashtalka3000 picture trashtalka3000  路  3Comments

MichaelLeeHobbs picture MichaelLeeHobbs  路  3Comments

imhuyqn picture imhuyqn  路  3Comments

danielonodje picture danielonodje  路  3Comments