wiki/content/20201112105833-javascript_short_circuiting_of_logical_operators.md

358 B

date id title
2020-11-12 2e3bb381-730b-416b-bd83-b99510244927 JavaScript Short Circuiting of Logical Operators

Syntax

console.log(null || "user")
console.log("Agnes" || "user")
console.log(0 || -1)
console.log("" || "!?")
console.log(true || "X")
console.log(false || "X")
console.log(true && "X")
console.log(false && "X")