I'm from Aguascalientes, Mexico! now based on New York. Most of my experience is related to code websites and applications, using JavaScript stack-based.
The document.all is an exception and I won't even use this in a codebase. If you try the typeof operator returns an "undefined", that's the reason no the function itself. Also, this is used by older browsers and is equivalent to document.getElementById.
In addition, "always better to handle pure boolean values." shows the lack of understanding about JS. falsy objects are helpful and the ability to coerce types makes it easier to work with them, with and without TS.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I disagree with this.
The falsy values are just:
The
document.all
is an exception and I won't even use this in a codebase. If you try thetypeof
operator returns an "undefined", that's the reason no the function itself. Also, this is used by older browsers and is equivalent todocument.getElementById
.In addition, "always better to handle pure boolean values." shows the lack of understanding about JS.
falsy
objects are helpful and the ability to coerce types makes it easier to work with them, with and without TS.