Initalizing variables challege help

Tell us what’s happening:

Your code so far


// Only change code below this line
var a; 
var b; 
var c; 
// 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 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36.

Challenge: Understanding Uninitialized Variables

Link to the challenge:

1 Like

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

The more information you give us, the more likely we are to be able to help.

Also, please do not include code within the title. Titles should describe your problem with keywords.

Thanks

1 Like

You need to assign something to these variables a, b, and c. Just like you would have done in the previous challenge.

var a =
‘var’ means you are creating a variable.
‘a’ is the name you are giving to the variable
= the equal sign is the assignment operator
after the equal sign you put whatever number or string (in quotes) you want. There are other options for assigning things to a variable but for this challenge just use number or string.
Now re-read the instructions for the challenge and give it another shot.

Tell us what’s happening:

Your code so far


// Only change code below this line
var a =5 
var b =10
var c = "i am a"
// 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 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36.

Challenge: Understanding Uninitialized Variables

Link to the challenge:

Hi!

Don’t forget to put ; after every line

1 Like

Hi @unegbunkolika!

Make sure to use correct text
“I am a”

1 Like

I believe the console in fCC can handle missing semicolons, but the i in i am a should be in capitals.

3 Likes

Be very careful with capitalization and spaces!

1 Like

Tell us what’s happening:

Your code so far


// Only change code below this line
var a =5; 
var b =10;
var c ="I am a";
// 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 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36.

Challenge: Understanding Uninitialized Variables

Link to the challenge:

Don’t change code you are not supposed to. That is why it is failing

2 Likes