JavaScript

Bind, Apply and Call

Callbacks and Promises

Error Handling

Map, Reduce, Filter

Objects

Prototypical Inheritance

Regular Expressions You can train for Regular Expressions in HackerRank. There is a special section.

Scope and Closures

this

Functions

Function in JS are first class citizens and you should know them well (assigned to a variable, passed as an argument, returned from another, etc.).

Output of this:

console.log(square(5));
/* ... */
function square(n) { return n * n; }

Output of this:

console.log(square(5));

var square = function(n) {
  return n * n;
}

Why do you do this?

var simpleLibrary = function() {
   var simpleLibrary = {
        a,
        b,
        add: function(a, b) {
            return a + b;
        },
        subtract: function(a, b) {
            return a - b;   
        }
   }
  return simpleLibrary;
}();

If more than one parameter has the same name in a function definition, the last occurrence “shadows” the preceding occurrences. Ref

Function references

Last updated on 20th Aug 2019