- = is for assignment
- == tests for equality of value and allows automatic casting
- === tests for equality of type and value
The following example illustrates the difference between =, ==, and ===
var x = 10 // int
var y = “10” // string
x == y // returns true
x === y // returns false
x==y casts y to an integer and then compares the two values, returning true
x === y tests for both type and value so there is no automatic casting. Since integer 10 is not equal to string 10, the test returns false