Whats wrong with this

Tell us what’s happening:
i dont get where im not doing it right

Your code so far
// Initialize these three variables
var a = 6;
var b = 15;
var c = “I am a String!”;

// Do not change code below this line

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


// Initialize these three variables
var a = 6;
var b = 15;
var 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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.106 Safari/537.36.

Challenge: Understanding Uninitialized Variables

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

What do the failing tests say?

// running tests

a

should be defined and evaluated to have the value of

6

.

b

should be defined and evaluated to have the value of

15

.

c

should not contain

undefined

and should have a value of “I am a String!” // tests completed

Read the directions carefully!

is that not what i did

ok i just tolk the word String! of var c and that solved the c is undefined problem but it still is saying that i dont have the values of var a& b defined

someone please help me

o i figured it out my variables werent = what they where supposed to becuase of the bottom code ex i have var a = 6 but at the bottom it had a= a + 1 so that would make it 7 not 6

As @JeremyLT pointed out, the instructions are to use the values 5, 10, and “I am a”. You used 6, 15 and “I am a String!”.

You need to read instructions carefully in this curriculum.

1 Like