loading...

re: The shortest way to conditional insert properties into an object literal VIEW POST

FULL DISCUSSION
 

For added fun with this, I tried a couple of things:

var state = 'tom';
var o = {
  name: 'test',
  state: state,
  ...( ( true && ( this.state = 'jamie' ) ) && false ) && { state } 

}
Code of Conduct Report abuse