4 Ways to define Methods in JavaScript Object

In this blog we will see how we can define a function in an object using 4 different syntax style. Four ways to define a method (function) in a JavaScript object are given below: Method without using function keyword Method with another function whose name is hidden Method with anonymous function Method with arrow function