JSFiddle - React, Tailwind, and code Playground

JavaScript

var data = {a: { x: 1, y: 2 }, b: 2, c:3};

var f = function(){
	this.a = data.a;
  this.d = data;
  this.geta = function(){
  	return this.a;
  }
  this.getd = function(){
  	return this.d;
  }
}

var foo = new f();

Object.assign(data, {a: { x: 5, y: 9 }, d:6});

console.log(foo.geta());
console.log(foo.getd());