Basic JavaScript - Understanding Uninitialized Variables

  • a should be defined and have a final value of 6.

  • Passed:b should be defined and have a final value of 15.

  • Passed:c should not contain undefined and should have a final value of the string I am a String!

  • Failed:You should not change code below the specified comment. How to do it

//Initialize these three variables
var a;
var b;
var c;

// Do not change code below this line

a = 5 + 1;
b = a + 9;
c = "I am a" + " String!";

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15

Challenge: Basic JavaScript - Understanding Uninitialized Variables

Link to the challenge:

I am not sure why you put this code here? but as you can see you were not supposed to change anything below the line like the comment says. You are going to have to restart to get the original code back
image

The directions say " Initialize the three variables a , b , and c with 5 , 10 , and "I am a" respectively so that they will not be undefined .

This should be done under the area where the challenge says
image

You will need to reset the lesson like I said to get everything back the way it needs to be

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.