I have been trying to solve part of the test of the topic Uninitialized Variables,
i can´t solve the following challenge:
c should not contain undefined and should have a value of “I am a String!”
I will appreciate and thank so much all the orientation provided, thanks in advance to you all,
Kind regards,
Ivonne
Your code so far
// Initialize these three variables
var a;
var b;
var c;
var a=5;
var b=10;
var c= c + "I am a String!";
// 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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36.
Dear MarcelPenn ,
thank you so much for the advise, is it right the code below :
i better attach you a picture about it.
I will appreciate and thank you so much your orientations and advises,
Kind regards,
Ivonne
For the initialization of the variables you do not need to declare it again. For example,
If you have “var a”. To initialize it you don’t have to retype “var a” but just assign it the value. That is to say:
var a;
var b;
var c;
a = 5
b = 10
Am I clear? On the other hand, on the variable c they give you a small instruction that is already initialized with the word “String” that implies that you have to initialize it only with the word “I am a”. For example
c = "I am a";
The rest of the code is
c = c + "String"
Their intention is to make you understand two things:
Thank you for the reply and orientation, i just have a questions, do we need to end the statement in
a declaration, initialisation and an assignment with a semicolon ?