Describe event bubbling.
this will change to reflect the firing element.Difference between document load event and document DOMContentLoaded event?
Explain “hoisting”
var is hoisted. const and let are not.Explain event delegation.
Explain Function.prototype.bind
theFunction.bind(valueForThis)(arg1, arg2, ...) (does not invoke function. params passed outside)thisExplain how ‘this’ works in JavaScript
Explain why the following doesn’t work as an IIFE: function foo(){ }();
Surround it with parenthesis. (foo(){})()
make this work ```javascript add(2, 5); // 7 add(2)(5); // 7
~~~
```javascript
let add = function(x, …xArgs) {
let total = x;
if (xArgs.length > 0) {
xArgs.forEach((el) => {
total += el;
});
return total;
} else {
return function(y) {
return total += y;
};
}
};
~~~
Make this work: duplicate([1,2,3,4,5]); // [1,2,3,4,5,1,2,3,4,5]
```javascript
let duplicate = function(arr) {
return arr.concat(arr);
}
~~~
What are IIFEs?
What is "use strict"? what are the advantages and disadvantages to using it?
What is a module in JS?
What is Ajax?
What is closure?
What is document.write
What is Dom?
What is jQuery?
What is prototype in JavaScript?
What is the difference between == and ===?
== will try to convert one side to the same type as the other.=== will strictly compare the two without any conversions.What’s a typical use case for anonymous functions?
What’s the difference between .call and .apply?
theFunction.apply(valueForThis, arrayOfArgs) apply -> arraytheFunction.call(valueForThis, arg1, arg2, ...)What’s the difference between a variable that is: null, undefined or undeclared?
- undefined variables exist, but don’t have anything assigned to them (typeof)
What’s the difference between an “attribute” and a “property”?
Why is it called a Ternary expression, what does the word “Ternary” indicate?
(1 === 1) ? true : false```javascript
if(conditional) { // one
// truethy_block // two
} else {
// falsey_block // three
}
~~~