JSFiddle - React, Tailwind, and code Playground

by Fu-Ching Hsiao

JavaScript

const temp = {
	a :1,
	fn(type){
		return Object.assign((type==1)?{b:2}:{c:3});
	}
}

let g = temp.fn(2);
console.log(g);