Comment Comment by almd true it is tedious but I have a vs code shortcut for doing the following (and same goes for queryselectorall) let foo = document.queryselector(‘.foo’);if (!!foo) { //do thing } parent almd 2 years ago
if (!!foo) { //do thing }