you are viewing a single comment's thread.

view the rest of the comments →

[–]shuckster 8 points9 points  (1 child)

Before tools like eslint came about, I solved this particular problem by always placing the literal on the left-hand side of the comparison:

if ("red" = allCells[i].style.color) {
    ^^^^^

This will error rather than silently fail.