---
title: "Discussion on \"Object-Oriented Programming in Javascript\" | Hashnode"
description: "Discussion on \"Object-Oriented Programming in Javascript\". 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. \nThe idea of OOP is that we use objects to model real-worl..."
url: "https://hashnode.com/posts/object-oriented-programming-in-javascript/607adcd4c99e200d08f7aea8"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Object-Oriented Programming in Javascript](https://jasmyneblog.hashnode.dev/object-oriented-programming-in-javascript?utm_source=hashnode&utm_medium=feed)

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...

Apr 17, 2021 · 4 min read · jasmyneblog.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#newbie](https://hashnode.com/tag/newbie)
-   [#developer](https://hashnode.com/tag/developer)
-   [#oop](https://hashnode.com/tag/oop)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Oluwadamilola Fagbore](https://hashnode.com/@DamilolaJasmyne)

@DamilolaJasmyne

  
[View profile](https://hashnode.com/@DamilolaJasmyne)

tech is fun

## Responses 1

Markdown supported · ⌘↵ to post

[Favourite Jome](https://hashnode.com/@Favourite)

[Apr 17, 2021](https://hashnode.com/posts/object-oriented-programming-in-javascript/607adcd4c99e200d08f7aea8/comment/607b088aeb2bd30d2d225f82)

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
```

[Oluwadamilola Fagbore](https://hashnode.com/@DamilolaJasmyne)

[Apr 23, 2021](https://hashnode.com/posts/object-oriented-programming-in-javascript/607adcd4c99e200d08f7aea8/comment/607b088aeb2bd30d2d225f82#reply-6082940eff5fc65284a77ce8)

Oh. thanks for pointing it out.

[Favourite Jome](https://hashnode.com/@Favourite)

[Apr 23, 2021](https://hashnode.com/posts/object-oriented-programming-in-javascript/607adcd4c99e200d08f7aea8/comment/607b088aeb2bd30d2d225f82#reply-6082aedcfea38e52a9c5a236)

You're welcome [Oluwadamilola Fagbore](https://hashnode.com/@DamilolaJasmyne)
