JSFiddle - React, Tailwind, and code Playground

by Abdul Ahmad

JavaScript

const outer = {
  inner: {
    laughter: "hahaha",
    laugh: function() {
      console.log(this.laughter) //`this` is window
    }
  }
}

const x = {
	laughter: 'hohoho',
  test: function () {
    const laugh = outer.inner.laugh
    outer.inner.laugh();
  }
}

x.test();