---
title: "Discussion on \"What is `this` inside foo.bar()?\" | Hashnode"
description: "Discussion on \"What is `this` inside foo.bar()?\". The problem\n\nCalling a method directly works as expected.But when we pass a method as callback, it loses reference to the original object (as this) when called.\nWhy is that? Can the spec help us explain this difference?\n\nThe explanation\nFor methods,\n..."
url: "https://hashnode.com/posts/what-is-this-inside-foobar/5e8178dfba34afe713b7d272"
---

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

Discussion

# [What is \`this\` inside foo.bar()?](https://bendtherules.hashnode.dev/what-is-this-inside-foobar?utm_source=hashnode&utm_medium=feed)

The problem Calling a method directly works as expected.But when we pass a method as callback, it loses reference to the original object (as this) when called. Why is that? Can the spec help us explain this difference? The explanation For methods, ...

Mar 30, 2020 · bendtherules.hashnode.dev  
Updated Apr 4, 2020  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#ecmascript](https://hashnode.com/tag/ecmascript)

## Written by

[Abhas Bhattacharya](https://hashnode.com/@bendtherules)

@bendtherules · Bangalore

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

Typescripting

I like to build developer tools in my spare time. I have tried dabbling with ASTs, TypeScript compiler api, webpack plugins, react custom re

## Responses 1

Markdown supported · ⌘↵ to post

[Aquib Vadsaria](https://hashnode.com/@aqumus)

[Dec 31, 2020](https://hashnode.com/posts/what-is-this-inside-foobar/5e8178dfba34afe713b7d272/comment/5fedd34cb2cf2458fe32677c)

Wonderful well written article, Beautifully mapped/explained the ES specs to understand the JS concepts Thanks for sharing :)
