A proposal to introduce new assignment forms for ECMAScript object literals
MIT License
A proposal to introduce new assignment forms for ECMAScript object literals
const obj = {
a: undefined,
b?: undefined
}
Object.hasOwn(obj, 'a') // true
Object.hasOwn(obj, 'b') // false
const obj = {
'a' : undefined,
'b' ?: undefined
// ^
// \___ Parsing the `?:` token
}
Object.hasOwn(obj, 'a') // true
Object.hasOwn(obj, 'b') // false
// Explicit string key
const a = undefined, b = undefined
const obj = {
a,
b?
// ^
// \___ Parsing the `?` token
}
Object.hasOwn(obj, 'a') // true
Object.hasOwn(obj, 'b') // false