JavaScript
1) What are the primitive types in JavaScript, and why do they matter?
2) Why is typeof null equal to "object"?
typeof null equal to "object"?3) Whatâs the difference between undefined and null?
undefined and null?4) How does JavaScript handle numbers internally?
5) When should you use BigInt?
BigInt?6) Explain pass-by-value vs pass-by-reference in JS.
7) Why do objects compare differently than primitives?
8) What is type coercion, and why is it dangerous?
9) Explain == vs === with a real âwhyâ.
== vs === with a real âwhyâ.10) Why is 0 == false true but 0 === false false?
0 == false true but 0 === false false?11) What are the falsy values in JS, and how does that affect logic?
12) Whatâs the difference between || and ???
|| and ???13) What is hoisting, and what exactly gets hoisted?
14) Why does var behave differently than let/const?
var behave differently than let/const?15) Explain TDZ (Temporal Dead Zone) in simple technical terms.
16) What happens in this code and why?
17) What happens here and why?
18) Whatâs the difference between function declaration and function expression hoisting?
19) Why does this work?
20) Why does this fail?
21) Explain lexical scope (âhow it worksâ).
22) What is block scope, and when does it matter most?
23) Why does let fix the classic loop + closure bug?
let fix the classic loop + closure bug?24) Compare var, let, const in 3 interview points.
var, let, const in 3 interview points.25) Why can you mutate a const object?
const object?26) What is the global object and why does it differ (browser vs Node)?
27) Why is globalThis useful?
globalThis useful?28) How does this behave at the top level?
this behave at the top level?29) Whatâs the difference between NaN and ânot definedâ?
NaN and ânot definedâ?30) Why does Number.isNaN() exist when isNaN() already exists?
Number.isNaN() exist when isNaN() already exists?31) Whatâs the difference between parseInt("08") and Number("08")?
parseInt("08") and Number("08")?32) Explain the difference between + unary and Number().
+ unary and Number().33) What happens with + when one operand is a string?
+ when one operand is a string?34) Why does [] + [] produce an empty string?
[] + [] produce an empty string?35) Why is [] == false true?
[] == false true?36) Explain Object.is() vs ===.
Object.is() vs ===.37) What is a âreference errorâ vs âtype errorâ?
38) What is a âshallow copyâ and why does it bite?
39) How does typeof behave for common values?
typeof behave for common values?40) How do you reliably check for arrays?
41) Why does delete behave differently on variables vs object properties?
delete behave differently on variables vs object properties?42) What is the difference between in and hasOwnProperty?
in and hasOwnProperty?43) What are âown propertiesâ vs inherited properties?
44) Why is for...in risky on objects?
for...in risky on objects?45) What does âimmutabilityâ mean for primitives?
46) Explain how const affects code safety (not âdefinitionâ).
const affects code safety (not âdefinitionâ).47) Why does JSON.stringify drop undefined and functions?
JSON.stringify drop undefined and functions?48) Whatâs the difference between âmissing propertyâ and âproperty with value undefinedâ?
49) Why does typeof never return "null"?
typeof never return "null"?50) Whatâs the most robust way to detect âplain objectsâ?
Last updated