JSFiddle - React, Tailwind, and code Playground
JavaScript
const temp = {
a :1,
fn(type){
return Object.assign((type==1)?{b:2}:{c:3});
}
}
let g = temp.fn(2);
console.log(g);
const temp = {
a :1,
fn(type){
return Object.assign((type==1)?{b:2}:{c:3});
}
}
let g = temp.fn(2);
console.log(g);