I've runned out of options

Tell us what’s happening:
Describe your issue in detail here.

Your code so fared

// Only change code below this line
var a = 7;
var b = 20;
var c = 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 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36

Challenge: Understanding Uninitialized Variables

Link to the challenge:

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

Look at this line:
var c = c + "I am a String!";

When you see this line of code, you have to put yourself in the interpreter shoes. The interpreter is the machine who will execute this code. It can be the browser or a terminal.

When Mr. Interpreter comes and see this line, it will first split it in every operation’s operand. So it will result in something like this:

1. var c 
2. c 
3. "I am a String!"

Mr. Interpreter will think: “Ohh! He is trying to store some values in the variable c”.

Mr. Interpreter will first resolve WHAT are you trying to store in the c variable.

c + "I am a String!";

The first thing it will see it’s a “c” variable, and will try to resolve it to its value. But, oh no!, the c variable doesn’t exist yet!.
Therefore, the brain of Mr. Interpreter will explode in a thousand of pieces and die.

To save Mr. Interpreter life, remove the initialized variable from there:

var c = "I am a String!";

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