0 == false // true '' == false // true null == undefined // true [] == '' // true (both become empty string) [] == 0 // true Always prefer === (no coercion), except when checking null == undefined . 7. Asynchronous Weirdness: Event Loop The weird part: JS is single-threaded but can handle async tasks.
function outer() let secret = 'closed over'; return function inner() console.log(secret); ;
typeof null; // 'object' (bug in JS) typeof function(){}; // 'function' (but not a separate type) [] instanceof Array; // true [] instanceof Object; // true (arrays are objects) false , 0 , '' (empty string), null , undefined , NaN , -0 , 0n
function getObj() return // ASI adds semicolon here → returns undefined ok: true ;
Анатолий
с Пн по Пт с 10 до 20:00
Антон
с Пн по Сб с 10 до 20:00
Дмитрий
с Пн по Пт с 10 до 20:00
Ян
с Пн по Пт с 10 до 20:00