Tried numerous attempets and can get it to run

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

Your code so far


// Only change code below this line
var a = 6;
var b = 15;
var c "I am a String!";
// Only change code above 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/95.0.4638.69 Safari/537.36

Challenge: Understanding Uninitialized Variables

Link to the challenge:

// Only change code below this line
var a = 6;
var b = 15;
var c "I am a String!";
// Only change code above this line

You are supposed to initialize the three variables a, b, and c with 5, 10, and “I am a” respectively. But you are initializing them with some other values. Also , you are missing an equal sign when you are assigning a value for variable c.

HI @Mike2106 !

This is a common problem that comes up a lot on the forum.

If you console.log(a), then it will return 7 which is incorrect.
It returns 7 because of this line here.

6+1 equals 7 but the test cases say this

a should be defined and evaluated to have the value of 6.

That is why a is supposed to be 5 here

so the outcome of the equation here results in 6

Same logic goes for fixing these lines of code

Hope that makes sense!

1 Like