Equals sign | Sololearn: Learn to code for FREE!


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


5 Answers

New Answer


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


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


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


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.


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