Basic JavaScript - Understanding Uninitialized Variables

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

// Only change code below this line
var a;
var b;
var c;
// Only change code above this line

a = a + 1;
b = b + 5;
c = c + " String!";

var a = 6;
var b = 15;
var c = "I am String"
a = 6;
b = 15;
c = c + "I am a String!";

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Understanding Uninitialized Variables

Link to the challenge:

you are supposed to modify these lines of code only to pass the challenge

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

in the example provided you only have the name of the variables that are a, b and c that right now have no values (they are undefined)

to have any results with the calculations below // Only change code above this line you need to equal each of them to the values you have been provided in the task itself

then in the calculations above, the console will put in place of the variable names, their values

you added a bunch of wrong code after //only change code above this line

i suggest you to push the button “reset” to start with the code before you modified and start fresh. it will only reset the current lesson and your progress so far will remain

Look at the variables between the lines:

// Only change code below this line
var a;
var b;
var c;
// Only change code above this line

  • At this precise moment in time: have they got a value?
  • Does the challenge suggest they have a value?
  • What are you going to do about it?
  • Between the lines…

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