Basic JavaScript - Understanding Uninitialized Variables

*The run test button stopped working. I was able to get as far as Understanding Uninitialized Variables section when the run test button stopped working. I disabled extensions, got rid of ad blockers, used 3 different browsers(google chrome, firefox and duckduckgo) and reset my computer and still no fixation. I am not sure why this is happening. Please help.

Your code so far

// Only change code below this line
var 6;
var 15;
var "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 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Understanding Uninitialized Variables

Link to the challenge:

The run test button usually indicates that it runs the test by marking off which you got right and wrong but it’s not marking anything.

You should be seeing a syntax error in the console pane because this is not valid JS syntax. Go back to the previous challenge (Declare String Variables) to remind yourself how to initialize a variable with a value.

1 Like

var 6;

var 15;

var c = “I am a String!”;

// Only change code above this line

a = a + 1;

b = b + 5;

c = c + " String!";

clicked the button. it should at least show me that the top 2 are right.

These two are still invalid syntax. Look at how you did the third one. Notice how you included the name of the variable in the declaration. You want to do that for these two as well.

You might want to restart the lesson to get the original JS back. You don’t want to remove/change any of the JS that is currently there. You just want to add to it.

//

// 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!";

You are getting closer. The instructions say:

Initialize the three variables a, b, and c with 5, 10, and "I am a"

So I think that you should initialize them with these values instead of what you have. Notice that 5 and 10 aren’t strings, they are numbers.

Oh. thank you so much!!!

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