Basic JavaScript - Understanding Uninitialized Variables

Tell us what’s happening:
i am not able to understand what will happen next i am very confused

Your code so far
// 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!";

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

Your browser information:

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

Challenge: Basic JavaScript - Understanding Uninitialized Variables

Link to the challenge:

A variable that is equal to itself + a value will result in concatenation, meaning they will be joined to each other.
e.g. var a = 10
a = a + 5;
a = 15; because 10 + 5 is 15

if var a contains a string like:
var a = “Meow Mix”;

and you type the following:

         a = a + " is great!"   

you end up with a = “Meow Mix is great!”

Now go back, slow down and follow the instructions in the challenge. Good luck.

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