Over the years, I’ve seen a lot of confusion about JavaScript function invocation. In particular, a lot of people have complained that the semantics of this in function invocations is confusing. In my opinion, a lot of this confusion is cleared up by understanding the core function invocation primitive, and

You are viewing a single thread.
View all comments
1 point

Do people still use this for functions? I’ve been in typescript for years, its all arrow functions and very few classes in our codebase. There are almost no this at all. Is it still comnon in js?

permalink
report
reply
2 points

this is very handy when you want to carry over some shared context. Justin Fagnani described this as an implicit first argument, which is a model that helped me understand how to use it better.

permalink
report
parent
reply
1 point

Cool. As mentioned, I have been in a different tech for a while now, and this article is from 2011, so I was interested if people do still use it

permalink
report
parent
reply

Programming

!programming@kbin.social

Create post

This magazine is dedicated to discussions on programming languages, software development, and coding. Whether you are a beginner programmer or an experienced developer, this is the place for you. Here you can share your knowledge, ask questions, and engage in discussions on topics such as coding languages, software engineering, web development, and more. From the latest trends and frameworks to tips and tricks for debugging, this category covers a wide range of topics related to programming.

Community stats

  • 1

    Monthly active users

  • 200

    Posts

  • 381

    Comments

Community moderators