Understandung the Understanding Uninitialized Variables

My code passed, but I have no idea why or what I was to get out of this. My code has asterisks.

Tell us what’s happening:

Your code so far

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

// Do not change code below this line

* a = 5;
* b = 10;
* var c = "I am a";

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






Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0.

Link to the challenge:
https://www.freecodecamp.org/challenges/understanding-uninitialized-variables

What don’t you understand. For example, the instructions say:

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

If you initialize a to 5, then a = a + 1 evaluates to 6, meeting the test, “a should be defined and have a value of 6”.

Is it the idea of initializing that is confusing you? Is it the math of how a ends up being 6?

You may be overthinking this one.

The challenge was attempting to drive home the idea that uninitialized variables cause unexpected results so be sure to init your variables.

var a;
var b = 10;

var c = b + 2;  //works, now c is 12

var d = a + 2; //d is NaN - you're not getting an expected result in d

Getting a result like NaN or “undefined” is actually a good thing in that at least your mistake is then obvious.

Sometimes not initializing a variable is not so obvious though.
Don’t do this - it is infinite loop so will crash your browser.

var i;
while(i != 100){  //sloppy test
   //do some stuff
   i++;
}