Question: How can I put a ternary conditional in a JS object literal?

```js
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.

Answer: 
You've almost got the right answer, you've just confused the order

```js
var options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]

var overlayEXVOORh = {
  "01": (options[0] == 1) ? 'EXVOORh01' : {},
  "03": (options[7] == 9) ? 'EXVOORh03' : {},
  "06": (options[5] == 6) ? 'EXVOORh06' : {},
  "08": (options[7] == 8) ? 'EXVOORh08' :
    {},
  "04": (options[3] == 4) ? 'EXVOORh04' :
    {},
};

console.log(overlayEXVOORh);
```

Edit:
Added failing condition `"03"`
You can do something like this:

```js
var options = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]

var overlayEXVOORh = {
  "01" : (options[0] == 1) ?  "EXVOORh01" : {},
  "06" : (options[5] == 6) ?  "EXVOORh06" : {},
  "08" : (options[7] == 8) ?  "EXVOORh08" : {},
  "04" : (options[3] == 4) ?  "EXVOORh04" : {}
};

console.log(overlayEXVOORh);
```