JavaScript Interview Questions Cleaned
JavaScript Interview Questions Cleaned
- JS moves declarations to the top before execution. var gets undefined, let/const give error if accessed
before declaration.
- A closure is a function that remembers variables from its parent scope even after the parent has finished
executing.
- Used to write async code that looks synchronous, works with Promises.
- this refers to different objects depending on context: global (window), object method (object), arrow function
(lexical).