# Assigning value to variables

Tell us what’s happening:
Describe your issue in detail here.
What am I doing wrong???

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

// Only change code below this line
var b;
b = a;
b = 7;

``````

User Agent is: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36`

Challenge: Assigning the Value of One Variable to Another

Pretend you don’t know already what is stored inside of `a`. You need to take whatever is stored in `a` and assign it to `b`.

1 Like

Hello !

The challenge is very simple, you just need to assign `b` the value of `a`.

So you did two things which weren’t needed. Let’s read your code

you don’t need to do this again as the variable `b` is already defined above in the code.

Well this line is all what you need to do in this challenge.

You don’t need to set the value of `b` manually, you have it already set to `a` which is `7` so no need for writing this.

I already did this but it still asks me to apply the value for b = 7

It isn’t asking you to manually set `b = 7` you should remove that line.

you declare b two times. i think to change it and declare only once place

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

// Only change code below this line

b = a;
b = 7;

``````

Yeah, the second variable declaration needs to be deleted, but so does `b = 7`.

You`re getting close to the solution, Please don’t write the actual solution out.

Tt 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.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

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