0
What is == (double equal)?
can you tell me what does == means
2 Respuestas
+ 8
"=" is assigning a value:
x = 5 (x is now equal to 5),
x = 76.93 (x is now equal to 76.93),
"==" checks if the values are equal:
5 == 76 (false because 5 is not equal to 76),
1 == true (true because 1 is equivalent to the value of true),
76.93 == "76.93" (true as even though they are have different data types the value are still equal)
also just to add on there is also "===" which checks the value and data type:
"5" === 5 (false as they hold the same value but are different data types)
1 === true (false for the reason as above)
"hello" === "bye" (false as they are the same data type but hold different values)
x = 10;
x === 10 (true as x holds the exact same value and data type)
455436 === 455436 (true as they are the same value and data type)
0
it means =, but in logic it writes ==