JavaScript Interview Questions
JavaScript Interview Questions
JavaScript
Interview Like a
Pro! À
by Gourav Roy
Difference between var, let, and const?
function outer() {
let count = 0;
return function inner() {
count++;
console.log(count);
};
}
const counter = outer();
counter(); // 1
counter(); // 2
What are arrow functions, and how do
they differ from regular functions?
Shorter syntax, do not have their own this, cannot be used as constructors.
console.log(await data.json());
}
What is the event loop
in JavaScript?
function multiplyBy(num) {
return function (x) {
return x * num;
};
}
const double = multiplyBy(2);
console.log(double(4)); // 8
What are pure
functions and why are
they important?