JS 1
JS 2
JS 3
JS 4
Bonus JS
100

JavaScript _______ are containers for storing data values.

What is: Variables?

100

A _______ is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a _____ gives you access to an outer function's scope from an inner function.

What is: Closure?

100

What are the 4 principles for "this" ?

What is:
1: Window/Global Object Binding
2: Implicit Binding
3: New binding
4: Explicit binding ?

100

With ES6 we gained the ability to use what is known as the ____ keyword. The ____ keyword is what we call “syntactic sugar” on top of the object built into JavaScript and the object’s prototype system. The ____ keyword is not a new way of achieving object-oriented inheritance in JavaScript.

What is: class ?

100

The ___________ is a function in JavaScript which is used to print any kind of variables defined before in it or to just print any message that needs to be displayed to the user.

What is: console.log() ?

200

JavaScript _____ are used to store multiple values in a single variable.

What is: array(s)?

200

A ______ function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action.

What is: Callback (function) ?

200

Which of the 4 principles of "this" does the example below follow?

When in the ______ scope, the value of “this” will be the ______/console Object;
-----------------------------------------

function sayName(name) {  console.log(this);  return name;
}
sayName("D'Artagnan");

What is: Global/Window Binding?
200

__________ is where classes shine. The `extends` keyword, and `super();` function make it trivial to bind our classes together to achieve some simple object __________ . The extends keyword will abstract away any of the `Class.call` syntax that we’re used to. `super()` tells a parent’s constructor to be concerned with the child’s attributes and abstracts away the Object.create(this, Class) syntax that is trickier to understand.

What is: Inheritance (with Classes) ?

200

Why do we need super() in an extended class?

What is: Using the super() keyword in extended classes allows the class that is an extension of another to gain access to the props/attributes that it is extending from. ?

300

An _____ can be created with figure brackets {…} with an optional list of properties.

What is: object?

300

The ____ method creates a new array with the results of calling a function for every array element. It calls the provided function once for each element in an array, in order.

Note: It does not execute the function for array elements without values.  

What is: map() ?

300

Which of the 4 principles of "this" does the example below follow?

Whenever a preceding dot calls a function, the object before the dot is this.
-----------------------------------------

const myObj = {  greeting: 'Hello',  sayHello: function(name) {    console.log(`${this.greeting} my name is ${name}`);    console.log(this);  }
};
myObj.sayHello('Ryan');

What is: Implicit Binding?

300

The _______ is an object that is associated with every functions and objects by default in JavaScript, where function's _______ property is accessible and modifiable and object's _______ property (aka attribute) is not visible. Every function includes _______ object by default.

What is: prototype ?

300

What is closure?

What is:
- Closure is used for inheritance. When nesting functions, child functions can access the parent scope.
- Closure is a scope chain, Nested functions have access to outer enclosing functions variables and it's own, but not the other way around. The first function is ran through, but leaves behind it's variables as closure for the nested functions to have access to, like DNA.
?

400

A JavaScript _____ is a block of code designed to perform a particular task. It is executed when "something" invokes it (calls it).


What is: function?

400

The _____ method creates an array filled with all array elements that pass a test (provided as a function).

Note: It does not execute the function for array elements without values.

Note: It does not change the original array.

What is: filter() ?

400

Which of the 4 principles of "this" does the example below follow?

Whenever we use a constructor function, this refers to the specific instance of the object that is created and returned by the constructor function.
-----------------------------------------

function CordialPerson(greeter) {  this.greeting = 'Hello ';  this.greeter = greeter;  this.speak = function() {    console.log(this.greeting + this.greeter);    console.log(this);  };
}

const jerry = new CordialPerson('Newman');
const newman = new CordialPerson('Jerry');

jerry.speak();
newman.speak();

What is: New Binding?

400

______ are in fact "special functions", and just as you can define function expressions and function declarations, the ____ syntax has two components: ____ expressions and ____ declarations.

What is: Class(es) ?

400

What is the difference between a function and a method?  (How is each passed?)

What is:

  • function, called by name and can be passed data (parameters) to operate and can optionally return data. (data is explicitly passed)
  • method, called by a name that is associated with an object, almost identical to a function. (implicitly passed).
    ?
500

What type of function is the below displaying?"

hello = () => {
  return "Hello World!";
}

What is: Arrow Function?

500

The ______ method reduces the array to a single value. It executes a provided function for each value of the array (from left-to-right). The return value of the function is stored in an accumulator (result/total).

Note: It does not execute the function for array elements without values.

Note: This method does not change the original array.

What is: reduce() ?

500

Which of the 4 principles of "this" does the example below follow?

Whenever we use JavaScript’s call or apply method, this is _____ defined.

We do so by calling them _______ with new functions, .call and .apply
-----------------------------------------

jerry.speak.call(newman); newman.speak.apply(jerry);

What is: Explicit Binding?

500

Why do we need super() in an extended class?

What is: The super keyword in JavaScript is used in order to call the methods of the parent class. By itself, super() is used within a constructor function to call the parent constructor function. ?

500

Describe the biggest difference between .forEach & .map.

What is:
The biggest difference is that forEach() allows the mutation of the original array, while map() returns a new array of the same size.
 ?