3 ms·
I believe they are referring to: let x = 5; if (x=3) { foo(); } The common defensive way of handling this is: if(3=x) { so it errors and catches
by ryanchants 5y ago
I believe they are referring to:
let x = 5;
if (x=3) {
foo();
}
The common defensive way of handling this is:
if(3=x) {
so it errors and catches the missing =
- mimixco 5y agoYes, that. = is for assignment and == is a test. The test inside your if needs == to work.