Setting attributeTwo using an if statement. What is the correct way to do this?
var testBoolean = true; var object = { attributeOne: \"attributeOne\", a
you can also do by this method
var testBoolean = true; var object = { attributeOne: "attributeOne" }
1
if(testBoolean){ object.attributeTwo = "attributeTwo" }else{ object.attributeTwo = "attributeTwoToo" }
2
object.attributeTwo = testBoolean ? "attributeTwo" : "attributeTwoToo"