Setting attributeTwo using an if statement. What is the correct way to do this?
var testBoolean = true; var object = { attributeOne: \"attributeOne\", a
No, however you can use the ternary operator:
var testBoolean = true; var object = { attributeOne: "attributeOne", attributeTwo: testBoolean ? "attributeTwo" : "attributeTwoToo" }