JSFiddle - React, Tailwind, and code Playground

by Abdul Ahmad

JavaScript

function say() {
	this.name = 'poo';
  console.log(this.name);
}


function getOb() {
	this.name = 'ob two';
  
  const ob2 = {
    name: 'ob inner',
    send: say,
    do() {
    	this.send();
    }
  };
  
  return ob2;
}


const theOb = getOb();
theOb.do();

console.log(theOb);