The object literal allows for new shorthands
with variables
the short version for {x: x}
is {x}
works with multiple variables too
with methods
using the name only uses it as key
a different key must be given explicitly, just like before ES6
inline functions, can written as obj={func(){}}
instead of obj={func:function(){}}
Required Knowledge
- basics (Arrow functions)
- `const` declaration (Block scope)
Related Katas
Global Object API
Object API
Object()
(as introduced in ES1)Object.is()
Object.fromEntries()
Object.fromEntries()
in depthObject.groupBy()
Object literal
- basics
- computed properties
- getter
- setter
Difficulty Level
INTERMEDIATE
First Published
25 March 2015
Stats
5 tests to solve