What am I doing wrong I keep getting an error saying that a needs to be assigned to b with = but I did that didnt I

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

Your code so far
// Setup
var a;
a = 7;
var b;

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

a = b;


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

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

a = b;

Your browser information:

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

Challenge: Assigning the Value of One Variable to Another

Link to the challenge:

Hey, right now you’re assigning “b” to “a” instead of “a” to “b”. Hope that helps!

If it makes it easier to understand, "assigning’ is like “giving”. Your essentially giving the contents of one to the other. The variable on the left is receiving the contents from the variable on the right. As such, right now, you’re giving the contents of “b” to “a”.

El hacer b=7; No es necesario. Esa no fue la pregunta. esa linea de codigo debe ser eliminada.
Luego a=b; Si borrastes la linea anterior, “b” no tendria ningun valor, seria igual a undefined. Y al hacer “a=b”, lo que haces es darle a “a” el valor de “b”, es decir undefined. ( a = b = undefined )
Y la pregunta es darle a “b” el valor de “a”. Lo que deberia ser igual a ( b = a = 7).
Espero se pueda entender.

Assign the contents of a to variable b .

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