# Call() method on javascript

**URL:** <https://forum.codewithmosh.com/t/call-method-on-javascript/17665>\
**Category:** Uncategorized\
**Created:** [January 13, 2023, 12:55pm UTC](https://forum.codewithmosh.com/t/call-method-on-javascript/17665 "2023-01-13T12:55:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuriAmancio](https://avatars.discourse-cdn.com/v4/letter/y/e47c2d/32.png) [@YuriAmancio](https://forum.codewithmosh.com/u/YuriAmancio)\
**Post date:** [January 13, 2023, 12:55pm UTC](https://forum.codewithmosh.com/t/call-method-on-javascript/17665/1 "2023-01-13T12:55:48Z")

</div>

How can I console.log this function using the call() method instead of creating a constant and using the new operator?

```auto
function Circle(radius) {
  this.radius = radius;
  this.draw = function() {
    console.log('hi');
  }
}

const another = new Circle(1);

```

---

<div class="post-metadata">

**Author:** ![AzharUddinSheikh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/azharuddinsheikh/32/5561_2.png) [@AzharUddinSheikh](https://forum.codewithmosh.com/u/AzharUddinSheikh)\
**Post date:** [January 13, 2023, 3:44pm UTC](https://forum.codewithmosh.com/t/call-method-on-javascript/17665/2 "2023-01-13T15:44:00Z")

</div>

are you trying to call `draw` function without creating `instance` of `Circle`

---

<div class="post-metadata">

**Author:** ![YuriAmancio](https://avatars.discourse-cdn.com/v4/letter/y/e47c2d/32.png) [@YuriAmancio](https://forum.codewithmosh.com/u/YuriAmancio)\
**Post date:** [January 14, 2023, 10:41am UTC](https://forum.codewithmosh.com/t/call-method-on-javascript/17665/3 "2023-01-14T10:41:20Z")

</div>

The lesson was saying that if we use `Circle.call({}, 1)` is the same as using const `another = new Circle(1);`

but if the first implementation is used, I can log the circle object to the console.

---

<div class="post-metadata">

**Author:** ![AzharUddinSheikh](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/azharuddinsheikh/32/5561_2.png) [@AzharUddinSheikh](https://forum.codewithmosh.com/u/AzharUddinSheikh)\
**Post date:** [February 1, 2023, 9:54am UTC](https://forum.codewithmosh.com/t/call-method-on-javascript/17665/4 "2023-02-01T09:54:39Z")

</div>

> [@YuriAmancio](#):
>
> Circle.call({}, 1)

`call` method is change the behavior of **`this`** as i remembered `Mosh` said `new Circle(1)` uses `call method` behind the hood
