반응형
let test = ' ';
console.log('[test]', test);
if (test) console.log('[TRUE]'); //' ', 1, -1, 1 / 0=Infinity,[],{}, () => {}
else console.log('[FALSE]'); //undefined,null,'', false, 0, 0 / 0=NaN
반응형
let test = ' ';
console.log('[test]', test);
if (test) console.log('[TRUE]'); //' ', 1, -1, 1 / 0=Infinity,[],{}, () => {}
else console.log('[FALSE]'); //undefined,null,'', false, 0, 0 / 0=NaN