Use another set of parenthesis?
...
conditional:((something)?"something":"nothing"),
...
Just have to let the parser know which :
to pay attention to and for which purpose.
var foo = {
bar: (true ? "true" : "false")
};
console.log(foo.bar); // true
You can also use a function(){}
if the decision needs to be made at the time of reference. e.g.
var foo = {
bar:function(){
return this.baz == 'Brad' ? 'Me' : 'Not Me';
},
baz: 'Brad'
};
console.log(foo.bar()); // 'Me'
foo.baz = 'Thomas'; console.log(foo.bar()); // 'Not Me'