Is there a way to destructure
an object having a hyphen in the property names. I get a SyntexError
while doing so (which is reasonable because JS doesn't allow variable name with a hyphen
).
let human= {
"first-name":"John",
"last-name":"Doe",
age:150
}
let {age}= human;
// let {"first-name"}= human;//error
// let {first-name}= human;//error
console.log(age)