What is this technique called

I believe this is some semblance of a JavaScript Object Literal but I can find no example if this technique I’ve found in a project I’m working on. What’s it called?

const calc = n =>
  ({
    true: 7,
    [n < 50]: 6,
    ...
    [n < 8]: 1,
  }.true); <!-- this '.true' right here?

>Solution :

It is just a dot-notation property accessor.

Leave a Reply