JSFiddle - React, Tailwind, and code Playground

by nickxbs

JavaScript

function test (){
    const myObject = {
        myMethod: () => {
          console.log(this);
        }
      };
      return  myObject;
}

test().myMethod() // this === window or global object