What is the difference between "I am a String" and "I am a String!"

What is the difference between "I am a String" and "I am a String!"
0.0 0

#1

Tell us what’s happening:

why should we write “I am a String!” in that way??

what is the difference between “I am a String” and “I am a String!”

Your code so far


// Initialize these three variables
var a;
var b;
var c;

// Do not change code below this line

a = a + 1;
b = b + 5;
c = c + " String!";

a = 6;
b =15;
c = "I am a String";

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/understanding-uninitialized-variables


#2

Because the instructions tell you to. The point of the lesson is that you can initialize a variable with a starting value and then later in the code (the part below the Do not change code below this line) you can use the initialized value in conjunction with a new value to change the value of the variable.

One string does not have an exclamation point at the end and the other does have an exclamation point at the end.


#3

Thanks for your comment…

So “I am a String!” is because of instruction.

if the instruction say “I am String” then it means we have to write “I am String”.


#4

The instructions does not tell you to write “I am String”. The instructions tell you to initialize the variable named c with the value “I am a”. You are not supposed to change any of the code below the 2nd comment (see below):

// Do not change code below this line

a = a + 1;
b = b + 5;
c = c + " String!";

Do not change any of the above code. Only change the 3 lines which start with var (located near the top of the code).