0
Can anyone explain clearly about comparison operator '==='?
3 ответов
+ 4
with a simple == you are testing values if they are equal but if you add one more = you check if the variable type is equal. for this reason 10=="10" is true but 10==="10" is wrong cause you are comparing an integer with a string.
0
That become usefull to compare types when you want to build a strict program, not wide open and ready to accept any type of input in a form for example.
0
Hi there.
=== means that the values you are comparing are identical.
Example: 3===4 is false. Because 4 is not 3.
3===3 is true. Because 3 is 3.
Do I answer your question?
Please let me know.
Good luck!