Understaning uninirialized variable

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

Your code so far


// Setup
var a;
a = 7;
var b;
b = 7;
a = b;


// Only change code below this line

Your browser information:

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

Challenge: Assigning the Value of One Variable to Another

Link to the challenge:

I am not able to create a code on this topic

// Only change code below this line

var a =5;

var b =10;

var c ="i am string!";

// Only change code above this line

a = a + 1;

b = b + 5;

c = c + " String!";

it is not completing chapter

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Can you provide more information? What do the failing tests say? What else have you tried?

It looks like the variables a and b are declared in the setup section, so you shouldn’t be redeclaring them with var below that.

Task:
Assign the contents of a to variable b .
Your code:

b = 7
a = b

Your code is not doing what the task said…

the lines and even what is in the “” are case sensitive;

at var = c = “i am string”;

the i change it to uppercase.

I think that would do.

The variable c should be initialized to the string "I am a".


You should link to the challenge you are currently on as it is different from the one in the initial post.

2 Likes

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