I found this snippet of code in my travels in researching JSON:
var array = typeof objArray != \'object\' ? JSON.parse(objArray) : objArray;
That’s called the conditional operator:
condition ? expr1 : expr2 If condition is true, the operator returns the value of expr1; otherwise, it returns the value of expr2.
condition ? expr1 : expr2
If condition is true, the operator returns the value of expr1; otherwise, it returns the value of expr2.
condition
true
expr1
expr2