If conditional judgment
-
For example,
let a = undefined; let b = null; let c = ''; let d = 0; let e = {}; let f = []; If (a) {console.log("undefined "); } else {console.log("undefined "); } if (b) {console.log("null "); } else {console.log("null cannot pass "); } if (c) {console.log(" 'console.log "); } else {console.log(" 'can't pass "); } if (d) {console.log("0 can pass "); } else {console.log("0 cannot pass "); } if (e) {console.log("{} console.log "); //{} can pass} else {console.log("{} cannot pass "); } if (f) {console.log("[] can pass "); } else {console.log("[] console.log "); }Copy the code