Dynamic Object Keys
Dynamic Keys
π¨βπΌ Nice work! You used computed property names to create keys like "404-status".
π¦ The key idea is a computed property name, which lets you use a variable
as the key when creating the object:
const key = 'status-404'
const errorPages = {
[key]: '/not-found',
}
This pattern is useful when a property name isn't a valid identifier.


