what shuld i do

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

Your code so far


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

// 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/93.0.4577.82 Safari/537.36

Challenge: Assigning the Value of One Variable to Another

Link to the challenge:

Var s=3;
Var t;
// the variable t is created but doesn’t have any //value, while variable s has a value of 3.
//To make t have the same value as t, this is what you //do.

t=s

//Do same to the exercise.

Your code:

var a;
a = 7;
var b;
b = 7;

The instructions say “assign the contents of a to variable b”.

In the example, which is exactly what you need to follow, they have a variable with the number 5 assigned to it, then they assign the value of that variable to another variable. But in that example, they don’t literally assign the number 5 to the second variable.

The last line of those four lines of code is not like the example. What are you doing differently?

Then:

var myVar=a;
myVar a; 7;
b=7;

You’ve added these three extra lines of code. What do you think they are doing?

If consoled, t will be equal to 3.
s will be equal to 3 too because the value of s was transferred to t using t=s

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