+ 1
difference between = and == ?
4 Answers
+ 7
One assigns the value of RHS to a variable the other one compares the values like:
var a = 9 // set a's value as 9
if ("2" == 2) alert("string 2 is equal to 2")
// check if string 2 is equal to 2, it will be equal in JavaScript.
+ 7
= is assignment operator
== is reference comparison
+ 3
@Lord Krishna sorry bro..
0
= is gir assigning the item on its right to the idenifiet to its left.
== tests to see if the left and right items are equal.