+ 2
what is ==
what does == mean?
3 Respostas
+ 9
It's an equality operator used to check if both values have the same value.
Example (in Javascript) -
if(2==2){
alert ("Equal")
}
The "==" equality operator returns true if both the values are equal else it returns false
+ 3
= is an Assignment Operator it is used to assign the value of variable or expression,
while == is an Equal to Operator and it is also a relation operator used for comparison (to compare value of both left and right side operands).
0
dont forget the explicit check aswell === this will also check if the left is the same value and type as the right.