How can I put a ternary conditional in a JS object literal?
var options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
var overlayEXVOORh = {
(options[0] == 1) ? "01" : EXVOORh01, : {};
(options[5] == 6) ? "06" : EXVOORh06, : {};
(options[7] == 8) ? "08" : EXVOORh08, : {};
(options[3] == 4) ? "04" : EXVOORh04, : {};
};
console.log(overlayEXVOORh);
Below is the JS object that is working, but i'm aiming to make it "smarter"
var overlayEXVOORh = {
"06": EXVOORh06,
"07": EXVOORh07,
"08": EXVOORh08,
"01": EXVOORh01,
"02": EXVOORh02,
"03": EXVOORh03,
};
The Object has to be key/value pairs because I'm using a leaflet library.