What am i not doing right

// Only change code below this line
var a;
var b;
var c;
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!"

What are you trying to do? What errors are you running into? What part do you need help with?

All, it showing all error, can you check please, if i answered them correctly

What do the errors say?

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 the string I am a String!

Declaring the variables twice can’t be right.

It would be much easier if you had used the Ask for Help button because we would have a link to the challenge you are working on.

Thats exactly what i used, that prompt me here

Oh. But you deleted all of the information in your first post… You deleted the part where you talk about the problem you are having and you deleted the part where you have a link to the challenge… That makes it much harder for us to help…

thats it here, you check here

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 the string

I am a String!
  1. You still haven’t provided a link to the challenge you are working on.

  2. Please don’t delete important information when you ask for help in the future.

  3. Unless you have changed your code, you still have the problem I pointed out:

1 Like

how do i go about it then?

I would start by deleting one of the two declarations for each variable.

which should i delete to make the code run??

Did you try deleting one of the two declarations for each variable?

This is a variable declaration.

This is also a variable declaration.

Each variable can only be declared once.

This is my code now, still not working

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

Well, what do the new error messages say?

Without a link to the challenge, I can’t read the error messages for myself. Also, learning how to describe problems actually helps make you a better programmer.

1 Like

HI @bickyseun !

I updated your post to include the challenge link so we know what is going on.
In the future, please use the Ask for Help button which includes your formatted code and challenge link.
Thanks! :grinning:


As for your code, you need to pay close attention to the directions.

Here are the directions again.
Initialize the three variables a , b , and c with 5 , 10 , and "I am a"

Right now you are initializing the three variables with 6,15 and "I am a String!"

Please make sure to use the correct values from the directions to pass the challenge.

When you use the correct values, then this code will produce the correct results.

Right now, that code does not produce the correct results because you are not using the correct values.

Hope that makes sense.

1 Like

Simple solution of your problem

Full solution
// 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!"

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.