Skip to main content

What is $(This) keyword in Node Enviornment

The things i need to remember:

In a normal function / function declaration / named function, “this” keyword refers to the object that the function is called

Arrow functions do not have their own bindings, so when “this” is accesses inside an arrow function, it is taken from outside.

when “this” keyword is used in a named function/function declaration, the “this” keyword is equal to the global object as long as the named function is in the global scope and not called on any object.

In the global scope the “this” keyword refers to module.exports object.

In a function expresson in the gloabal scope this keyword reffers to module.exports object.