Can you name two programming paradigms important for JavaScript developers?
What is the difference between classical inheritance and prototypal inheritance?
What does map() do? (2)
What does reduce() do? (3)
What does filter() do? (2)
What is a stack? How would you implement a stack in JS? (3)
What is a queue? How would you implement a queue in JS? (3)
What does call() do in JS? (2)
this, then this will refer to the argument objectWhat does apply() do in JS? (2)
this, then this will refer to the argument objectWhat is lexical scope?
Scope created within a function, defined with var
What is block scope?
The keywords let and const define block scoped variables in pairs of curly brackets, otherwise JS doesn’t support block scope
What is scope chaining?
If you think of nested scoping as a tree structure, where a function b() nested in a() is a child node to a(), a scope chain is the path from a node to the root node
What sits at the top of every scope chain?
A global scope object, which is window in the browser and global in node
What is scope shadowing?
In a nested function, declaring a lexically scoped variable with the same name as a lexically scoped variable in the parent function is valid, and the nested function only has access to it’s locally scoped variable (normally it would have access to the parents variable too)
What is a closure?
If an inner function accesses a value in an outer function, it is said to close over that value, hence is a closure. This inner function can then be returned from the outer function, and still access the outer variable.
In other words, closure is when a function is able to remember and access its lexical scope even when that function is executing outside its lexical scope.
What is garbage collection?
When the JS runtime decides when/if to release any allocated memory.
How does JS runtime garbage collect a closure? (2)
What does splice() do? (2)
What is hoisting? (2)
How does this work in JS?
The context of a function, what is referred with the this keyword, in JavaScript depends on how a function is invoked, not how it’s defined.
What is a set in JS?
A set is a collection of items which are unique i.e no element can be repeated.
What does spread (…) do in JS?
Why would you use a Set in JS? (2)
* When order doesn’t matter
What are the advantages of declarative programming? (3)