1
lopu
305d

Am I a genius?

```
const co = (obj) { return obj[true] }

src={co({ [isBreakfast]: img1, [!isBreakfast]: img2 })}
```

Comments
  • 0
    @jestdotty 😂

    Better than a bunch of friggin ? : ? : ? : ? : ? : ? : ? : ? : ? : ? : ? : ? : ?
  • 0
    This is the exact same as a ternary, except worse in several ways:

    - eager
    - chaining creates pyramids
    - I suspect it's much slower because dynamically generated object keys fuck with optimizers.
Add Comment