What is JavaScript?
JavaScript is a single-threaded, high-level language used to make web pages interactive, build servers with Node.js, and create
apps. It supports event-driven and asynchronous programming.
Showing 1-6 of 36 questions
JavaScript is a single-threaded, high-level language used to make web pages interactive, build servers with Node.js, and create
apps. It supports event-driven and asynchronous programming.
var is function-scoped and hoisted. let and const are block-scoped. const cannot be reassigned, but object properties inside a
const object can still change.
Hoisting means declarations are moved to the top of their scope during compilation. var is initialized as undefined; let/const are
hoisted but stay in temporal dead zone until declared.
string, number, bigint, boolean, undefined, symbol, and null. Primitives are immutable and compared by value.
== performs type coercion before comparison. === compares both value and type, so it is safer and preferred in production code.
A closure is when an inner function remembers variables from its outer scope even after the outer function has returned. It is used
in counters, private state, debounce, and function factories.