this refer to inside a regular function in JavaScript?In a regular function, this refers to the object that called the function. If no object called it, this is undefined in strict mode or the global object in non-strict mode.
this behave inside an arrow function?An arrow function does not have its own this. Instead, it uses this from the surrounding (lexical) scope where it was defined.
this when a function is called as a method of an object?When called as a method, this refers to the object before the dot that called the method.
this when you use call() or apply() to invoke a function?You can explicitly set this by passing the object you want as the first argument to call() or apply(). The function runs with this set to that object.
this inside a nested regular function lose the outer this?Because each regular function has its own this, a nested function called inside another function has this set to undefined in strict mode or the global object in non-strict mode, not the outer function's this. Arrow functions avoid this problem.
this refer to when called as a method of an object?When a function is called as a method, this points to the object before the dot.
this inside an arrow function?Arrow functions do not have their own this. They use the this from where they were created.
call() do with this?call() lets you specify what this should be inside the function.
this inside a nested regular function?Nested regular functions have their own this, which is usually undefined or the global object.
this?Arrow functions inherit this from their surrounding scope.
this behaves differently in regular functions versus arrow functions.this when calling a function.