Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Logical NOT in JavaScript
//JavaScript-C24.2.0 (SpiderMonkey) // The '!' (Logical NOT) operator returns true if the value given is false // Let's check all the instances, when this applies // Read more: // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_Operators const emptyVariableIsUntrue; var untrueTable = [emptyVariableIsUntrue, NaN, undefined, null, false, 0, '', "", [], {}]; untrueTable.forEach(instance => { if (!instance) print(instance + " is false"); else print(instance + " is true"); }); // Empty object passes as true, in any other case false // Can we find more instances?
run
|
edit
|
history
|
help
2
single_digit
Looping Strings
SKYIES
My first app
JS is_sorted
Objects
Herrn
Nombre en MAYÚSCULAS
sortStack
ECMAScript5 - js