Cannot for the LIFE of me pass this module

I keep seeing past posts about this exact problem and my code looks the same as theirs and all of a sudden they figure it out but don’t come back and say anything. And the comments from coders haven’t been to helpful. I’ve tried a few different codes and I’d really like to move forward in the module.

Unfortunately the cpu I’m on can’t take a screen shot so I’m C&P below some of my attempts. Can someone please tell me where I’m going wrong?

// Only change code below this line

var a; = 5; var a; = 5 + 1 = 6 var a; = 6

var b; = 10; var b; = 10 + 5= 15 var b; = 15

var c; = “I am a;” var c; = “I am a;” + “String!;” var c; = “I am a String!;”

// Only change code above this line

a = a + 1;

b = b + 5;

c = c + " String!";

#2 that I tried:

// Only change code below this line

var a; = 5 + 1 = 6 var a; = 6;

var b; = 10 + 5 = 15 var b; = 15;

var c; = “I am a” + “String!” = “I am a String!;” var c; = “I am a String!;”

// Only change code above this line

a = a + 1;

b = b + 5;

c = c + " String!";

#3 that I tried

// Only change code below this line

var a; = 5;

var b; = 10;

var c; = “I am a;”

// Only change code above this line

a = a + 1;

b = b + 5;

Each time I’m getting the same results:

a should be defined and have a final value of 6

b should be defined and have a final value of 15

c should be defined and have a final value of “I am a String!”

An explanation as to why the answer is what the answer is would be super helpful. I’d also like the solve please, I’m crying “uncle!” Thank you!

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge. This button only appears if you have tried to submit an answer at least three times.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

If the help button isn’t working, please let me know.

Can you please specify in which section you found the question?

I’m not sure I entirely understand what you’re asking me but this is Basic Java Principles, “Legacy JavaScript Algorithms and Data Structures” and the module is “Understanding Uninitialized Variables”

Okay, I can see the problem now, you misused the ; sign.
In JavaScript, the ; is used to indicate the end of an instruction and it is usually used once per line, your third try is the closest to the correct answer, just remove the ; after the variables a, b and c and remove the ; inside the string I am a

Tell us what’s happening:

I keep seeing past posts about this exact problem and my code looks the same as theirs and all of a sudden they figure it out but don’t come back and say anything. And the comments from coders haven’t been to helpful. I’ve tried a few different codes and I’d really like to move forward in the module.

Your code so far

// Only change code below this line
var a;=5;  var a; = 5+1 var a; = 6
var b;=10; var b; = 10 + 5 var b; = 15
var c;="I am a;" var c; = "I am a;" + " String!;" 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 (X11; CrOS x86_64 14324.72.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.91 Safari/537.36

Challenge Information:

Basic JavaScript - Understanding Uninitialized Variables

This is the code which you start this step with:

var a;
var b;
var c;

You can hit the Reset button to restore this.
The code above uses the var keyword to declare three variables, a, b and c.
They are declared without an initial value, so all exist but are undefined.
You can assign and reassign values to these variables using the assignment operator (=).

For example, var a = 20, would instead declare the variable a and assign it a value of 20.

So, change the three lines of code above, so that they are declared with the values specified in the instructions.

NOTE: The semicolons (;) at the end of each line of code are a convention to show where the line of code ends. They’re not essential but can be useful. Any code you add on each line should come before the semicolon.

unfortunately, this did not work :frowning:

wait, just kidding! it did - thank you SO much!!! pretty sneaky of them to start with the ; already on the variables. thank you again!!

1 Like