cover-img

JavaScript "this" keyword Explained by 4 Binding Rules💛

6 June, 2022

14

14

0

JavaScript "This" one of the important JavaScript Topics

☆ What we think when we say "THIS" . like something is referring or addersing something Right
☆ The JavaScript "this" Keyword which is used in a function, refers to the object it belongs to it makes functions reusable by letting you decide the object value
☆ same happens with JavaScript Through functions . In simple words when the function is called/invoked. we cannot find out "THIS" keyword until it invoked/called , The this keyword used by binding methods they are few ways of this keyword is classified are follows 1. IMPLICIT BINDING 2.EXPLICIT BINDING 3. NEW BINDING 4. DEFAULT BINDING

What is Binding

Binding in simple words a bundle of pages attached to a file or a strong covering holding the pages of a book together Binding is environment where the code is written and called/invoked by the functionBnding allows us to easily set which object will be bound by the this keyword when a function or method is invoked.

➜IMPLICIT BINDING

⯮ The "this" Keyword refers to the object which the property (name) & value (Lion). ⯮ we call the object using the dot notation in which the function is placed.
⯮ it’s that object should be used for the function fall’s to the this
img
⯮ In explicit binding, we can call a function with an object when the function is outside of the execution context of the object.
⯮ Each execution context operates independently from the others.
⯮ In Explicit Binding function is not inside, the function is placed outside and being called by these 3 methos ⯮There are three methods, call(), apply() and bind() to evoke the explicit binding.
img
⯮ In new binding the (this.name) saved & returned by new keyword ⯮ new keyword is used to create an object form the constructor function.
img
⯮ We use the global binding/ default when above binding methods are not resolve ⯮ we use globalThis.name (the name of the value)
⯮ JavaScript strict mode  does not allow this default binding.
img
Thank you for reading

🤗

javascript

bindingrules

"this"

keyword

14

14

0

javascript

bindingrules

"this"

keyword

Sanathan Rao
Frontend dev • sharing my Learnings • resourses • Learning web development

More Articles

Showwcase is a professional tech network with over 0 users from over 150 countries. We assist tech professionals in showcasing their unique skills through dedicated profiles and connect them with top global companies for career opportunities.

© Copyright 2025. Showcase Creators Inc. All rights reserved.