JSFiddle - React, Tailwind, and code Playground

by Vladymyr Shevchuk

JavaScript

const obj = {
	name: 'Batman',
  getName: function() {
    console.log(this.name);
  }
};

obj.getName(); // Batman

const anotherObj = {
  name: 'Superman'
}

obj.getName.call(anotherObj);