DEV Community

Calvin
Calvin

Posted on

1

Reading Snippets [47 => This] 👉

"This" is used differently in JavaScript from how it is used in most other programming languages.

The five ways "This" can be used in JavaScript include:

  • In a global scope to refer to the global object

  • To refer to the global function when calling a function

  • Calling a method

  • To refer to a newly created object when calling a constructor

  • Explicit setting to the first argument of a corresponding function call

Source:JavaScript Garden

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay