It is very easy to get things confused (just as I was) when learning about this aspect of Javascript: Object-Oriented Programming(OOP). So let's start from the basics as this will help a lot. The idea of OOP is that we use objects to model real-worl...

Markdown supported · ⌘↵ to post
Favourite Jome
Nicely written introduction to OOP. I noticed you made a mistake in an example, the method is outside the object.
let user = { firstName: "Jane", lastName: "Doe", //method getFunction : function(){ return (`The name of the person is ${person.firstName} ${person.lastName}`) } console.log(user.getFunction());// The name of the person is Jane Doe