Equals sign | Sololearn: Learn to code for FREE!

0

Equals sign

It seems simple but i'm having a little trouble understanding what it means. One the examples is x = y does that mean y will become x?

12/23/2016 5:54:53 PM

Alton

5 Answers

New Answer

+3

If you write that in the javascript codeplayground: var x = 10; var y = 25; document.write(x = y) It returns the result of 25. = is the assignment operator which gives the value of one thing to another. The course says that it makes the first variable entered (x) take on the value of the second variable (y). So in the above example (hold onto your paradox objections) the variable that previously was set to 10 (x) is now the same as the variable previously set to 25 (y).

+2

The value of x is gonna be the value of y. They gonna have the same values

+2

let x=10 So if you put x+x you'll get 20

+2

Yes 2 things 1) Statement or expression 1) X =10 : assigning values to a variable 2) X= Y Assigning variable value to another variable. 2) Question If X = Y then do this..... Here it verifies X = Y ? then it performs the action. Hope it helps.

0

Lets say x = 10 y = 25 Document.write (x = y) or something similar