Just a few weeks until the 2021 JavaScript Full-Stack Bootcamp opens.
Signup to the waiting list!



A function lives on its own:

const bark = () => {
  console.log('wof!')
}

bark()

or

function bark() {
  console.log('wof!')
}

bark()

A method is a function assigned to an object property:

const dog = {
  bark: () => {
    console.log('wof!')
  },
}

dog.bark()

The method can access the object properties, but only when it’s a regular function, not an arrow function:

const dog = {
  name: 'Roger',
  bark: function () {
    console.log(`I am ${this.name}. wof!`)
  },
}

dog.bark()


The 2021 JavaScript Full-Stack Bootcamp will start at the end of March 2021. Don't miss this opportunity, signup to the waiting list!

More js tutorials: