79712070

Date: 2025-07-23 14:20:35
Score: 1.5
Natty:
Report link

A bit of an old thread, but I had this happen when I initialised the variable with false

let tab_clicked = false;
tab_clicked = document.querySelector("button");
  if (tab_clicked) {
// DID NOT WORK
}

let tab_clicked = '';
tab_clicked = document.querySelector("button");
  if (tab_clicked !== '') {
// DID  WORK :D
}
Reasons:
  • Blacklisted phrase (1): DID NOT WORK
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Sarah Eagle