FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
This Keyword in JS
How-ToWeb Development

This Keyword in JS

via Dev.toKush Bhandari2h ago

this keyword of javascript actually confuse a lots of junior and senior developer. So let me explain in the easist way possible. this behavior doen't depend upon where this is used but from where it is called. Understand this by a example. Example: let obj = { name : " Kush " , displayName (){ console . log ( `My name is ${ this . name } ` ); } } Now, when obj.displayName() is called we get output as : // My name is Kush. But what if i change this to something like this : let person=obj.displayName; person(); Now the output will be : // My name is undefined. So, this show us that the execution of this is more important then the place where this is defined. In non strict mode, this point to the global window object in browser and can be different in other runtimes. In strict mode, this point to the undefined. Arrow function: Arrow functions do not have their own this; they capture this from their lexical scope (where they were created). let obj = { name : " Kush " , personName :() => {

Continue reading on Dev.to

Opens in a new tab

Read Full Article
0 views

Related Articles

The Struggle of Building in Public and How Automation Can Help
How-To

The Struggle of Building in Public and How Automation Can Help

Dev.to Tutorial • 1h ago

Reverse Proxy vs Load Balancer
How-To

Reverse Proxy vs Load Balancer

Medium Programming • 2h ago

How I synced real-time CS2 predictions with Twitch stream delay
How-To

How I synced real-time CS2 predictions with Twitch stream delay

Dev.to • 4h ago

The Go Paradox: Why Go’s Simplicity Creates Complexity
How-To

The Go Paradox: Why Go’s Simplicity Creates Complexity

Medium Programming • 10h ago

How-To

The Cube That Taught Me to Code

Medium Programming • 11h ago

Discover More Articles