Call and Apply

Call and apply is that call requires the arguments to be passed in one-by-one, and apply takes the arguments as an array.

A for array and C for comma.”

function longerSummary(genre, year) {
    `${this.title} was written by ${}. It is a ${genre} novel written in ${year}.`
}, 'dystopian', 1932)
longerSummary.apply(book, ['dystopian', 1932])
Functions vs arrow

Arrow functions do not have their own this binding. Instead, they go up to the next level of execution.

const whoAmI = {
  name: 'Leslie Knope',
  regularFunction: function () {
  arrowFunction: () => {

whoAmI.regularFunction() // "Leslie Knope"
whoAmI.arrowFunction() // undefined

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.