Unable to pass this test can someone help me out

Tell us what’s happening:
Unable to to initialize var c to the string value of “i am a” ,
This below test is failing:
"c should not contain undefined and should have a value of the string I am a String!"

Your code so far

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

Challenge: Understanding Uninitialized Variables

Link to the challenge:

This is a tricky one, so I will just give you the answer.
Quotation marks on your keyboard may be somewhat different than expected.
← your quotation mark
" or ' ← quotation mark that is used as a string ‘container’
You can see the right ones in the last line of code.

1 Like

variables are already initialized…

// Only change code below this line
var a = 5;
var b = 10;
var c = “I am a”;
// Only change code above this line

a += 1;
b += 5;
c += " String!";
console.log(`a:${a}, b: ${b}, c: ${c}`);
1 Like

Ok, I will be a not-so-nice-helper.

I copy-pasted your code, checked the error, corrected the code and passed the test.
Variables are NOT initialized correctly. If you see no difference between strings on line 8 and 12 then… whatever.

1 Like

Hi @ravitejatumuluri.rt !

Welcome to the forum!

These are called smart quotes

You need to turn smart quotes off on your device. Then the test will pass.
But as mentioned earlier, you don’t need to redeclare the variables.

You can just have this part with the correct quotes.

1 Like

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