Say I have an array definition
var array = [
"One",
"Two",
"Three",
]
...but I only want "three" to be added when another variable is true.
var array = [
"One",
"Two",
(addThree ? "Three" : undefined),
]
The issue is, if addThree is false, then the array becomes ["One","Two",undefined] when I just want it to be ["One","Two"].
...(addThree ? ['Three'] : [])