---
title: "Comment by Favourite Jome on \"Object-Oriented Programming in Javascript\" | Hashnode"
description: "Nicely written introduction to OOP. I noticed you made a mistake in an example, the method is outside the object. let user = { firstName : &quot;Jane&quot; , la"
url: "https://hashnode.com/posts/object-oriented-programming-in-javascript/607adcd4c99e200d08f7aea8/comment/607b088aeb2bd30d2d225f82"
---

[Discussion](https://hashnode.com/posts/object-oriented-programming-in-javascript/607adcd4c99e200d08f7aea8)

Comment [Object-Oriented Programming in Javascript](https://hashnode.com/posts/object-oriented-programming-in-javascript/607adcd4c99e200d08f7aea8)

[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)
