JSFiddle - React, Tailwind, and code Playground
JavaScript
var Item = {
_first : undefined,
_second : undefined
};
Object.defineProperty(Item, "whole", {
get : function(){
if (this._first && this._second) return this._first + '_' + this._second;
return '{ Invalid Values }';
},
enumerable : true,
configurable : true}
);
console.log(Item.whole);
Item._first = "a";
Item._second = "b";
console.log(Item.whole);