Understanding "this" in javascript with arrow functions | Codementor

PHOTO EMBED

Mon Jan 08 2024 17:18:21 GMT+0000 (Coordinated Universal Time)

Saved by @msagr

const myObject = {
  myArrowFunction: null,
  myMethod: function () {
    this.myArrowFunction = () => { console.log(this) };
  }
};
content_copyCOPY

nice way to add function definition inside of object.

https://www.codementor.io/@dariogarciamoya/understanding-this-in-javascript-with-arrow-functions-gcpjwfyuc