I have such variable declaration in my JavaScript method on :
var MyVariable = {
CarMake: "Lexus",
CarColor: "Black"
}
What I am trying to accomplish is to add some login within MyVariable declaration such as:
var MyVariable = {
CarMake: "Lexus",
if (carType == "sedan") {
NumberOfDoors: 4,
}
CarColor: "Black"
}
Is this possible somehow?