Basic JavaScript - Understanding Uninitialized Variables

Tell us what’s happening:
Hi. I think my code is correct but when I run the tests, I receive the response below:

c should not contain an undefined and should have the final value of the string “I am a string!”

You should not change code below a specified comment.

Your code so far

// Initialize these three variables 
var a = 5;
var b = 10;
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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Basic JavaScript - Understanding Uninitialized Variables

Link to the challenge:

Add a console.log at the bottom to see what the value is.


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