# Clarifying "this"

**URL:** <https://group.classcentral.com/t/clarifying-this/24416>\
**Category:** JavaScript Bootcamp\
**Created:** [February 15, 2022, 1:29am UTC](https://group.classcentral.com/t/clarifying-this/24416 "2022-02-15T01:29:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacobra\_the\_Great](https://sea2.discourse-cdn.com/flex016/user_avatar/group.classcentral.com/jacobra_the_great/32/3612_2.png) [@Jacobra\_the\_Great](https://group.classcentral.com/u/Jacobra_the_Great)\
**Post date:** [February 15, 2022, 1:29am UTC](https://group.classcentral.com/t/clarifying-this/24416/1 "2022-02-15T01:29:14Z")

</div>

I think I just had a click moment, but I’m hoping for clarification from someone with greater experience.

In a function, when calling “this” with dot notation, it’s creating an object. For example:

function myName(name) {  
this.name = name;  
};

would result in an object called name, with a key of name made up of whatever name was entered as a parameter:

myName(Jacob);  
would result in creating this object:

myName {  
name: “Jacob”  
};

I realized this after console logging “typeof this” and it gave me “object”.

Is this correct? Am I close? Or am I way off? Inquiring minds want to know!

(And yes, I’m sure this has been covered already in the course, but my brain has only just now processed the logic. Yeesh!)

---

<div class="post-metadata">

**Author:** ![johannesvansc2679278](https://sea2.discourse-cdn.com/flex016/user_avatar/group.classcentral.com/johannesvansc2679278/32/2989_2.png) [@johannesvansc2679278](https://group.classcentral.com/u/johannesvansc2679278)\
**Post date:** [February 15, 2022, 2:21pm UTC](https://group.classcentral.com/t/clarifying-this/24416/2 "2022-02-15T14:21:33Z")

</div>

And it allows you to do this:

```auto
let myName = {
  name: "Jacob",
  logName: function() {
    console.log(this.name);
  }
};
myName.logName(); // Jacob

```

---

<div class="post-metadata">

**Author:** ![Jacobra\_the\_Great](https://sea2.discourse-cdn.com/flex016/user_avatar/group.classcentral.com/jacobra_the_great/32/3612_2.png) [@Jacobra\_the\_Great](https://group.classcentral.com/u/Jacobra_the_Great)\
**Post date:** [February 15, 2022, 5:47pm UTC](https://group.classcentral.com/t/clarifying-this/24416/3 "2022-02-15T17:47:20Z")

</div>

Awesome! Thanks for the feedback!
