Basic JavaScript - Understanding Uninitialized Variables

Tell us what’s happening:
Describe your issue in detail here.
I Cannot understand this , Why is it rejecting my code?

Your code so far

a = a + 1;
b = b + 5;
c = c + " String!";
// 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 a String!”;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/110.0

Challenge: Basic JavaScript - Understanding Uninitialized Variables

Link to the challenge:

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

You should be initialising the variables at the top of the page, where the comments tell you to. Once variables are declared (with var, let or const), you shouldn’t re-declare them.
Also, you should be initialising the variables with the values described above.

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