+ 5
Would this return True? "basketball" = "football"
Javascript
4 Réponses
+ 15
'=' is the assign operator, which is different from '=='. Use the latter to compare two variables instead of the former.
To answer the question though, it would probs return true for ("basketball" = "football") due to the flaw in operator usage. That's for C++, not sure about JS.
+ 3
ok thank you 😀
+ 1
@Hatsy Rei it works the same in js
0
You are only assigning one to the others here, there is no trace o f comparison so the logical results of true or false cannot hold