Help, what's wrong with my code **Challenge:** Understanding Uninitialized Variables

Tell us what’s happening:
c should not contain undefined and should have a value of “I am a String!”

You should not change code below the specified comment

help, what’s wrong with my code

Your code so far


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

Challenge: Understanding Uninitialized Variables

Link to the challenge:

var c should be initialised before it is used since it is a string. try initialising it right after declaration
Credits to: pmayur

1 Like

Hi Iammoshin,

With the code, you have written your c variable will equal “I am a String! String!”
best way to check what is being outputted it to console.log(c);

Best of luck

3 Likes