Understanding Uninitialized Variables new

Tell us what’s happening:

I do not understand this exercise and I have been stuck for about 15 min

Your code so far


// Initialize these three variables
var a; var a = 5 + var a
var b; var b = 10 + var b
var c; var c =  var c + "I am a"

// Do not change code below this line

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36.

So, to “declare” a variable, to tell my script to assign a block o memory, i just var foo; . To assign a value into that space, i would foo = 12;. So can you see the difference?

For each variable just use var once, that is a good place to start.

To initialise a variable it means to assign it a value when it is declared

1 Like