const data = {
"key-with-dash": ["BAZ"]
}
const {"key-with-dash": foo} = data;
console.log("foo", foo);
More Related Contents:
- One-liner to take some properties from object in ES 6
- What is destructuring assignment and its uses?
- Where can I get info on the object parameter syntax for JavaScript functions?
- Is it possible to destructure onto an existing object? (Javascript ES6)
- What does curly brackets in the `var { … } = …` statements do?
- ES6/ES2015 object destructuring and changing target variable
- How do I destructure all properties into the current scope/closure in ES2015?
- ES6 destructuring function parameter – naming root object
- Destructuring in Node.JS
- Destructuring and rename property
- ES6 Destructuring and Module imports
- Destructuring Nested objects in javascript | Destructure second level parent and child Objects
- ES6 destructuring object assignment function parameter default value
- How to destructure option argument with all default values in ES6?
- Curly brackets (braces) in Node.js ‘require’ statement
- Node JS / V8 destructuring bug?
- How to bind methods when destructuring an object in JavaScript?
- object destructuring: how to use intermediate nested property
- Methods in ES6 objects: using arrow functions
- Null-safe property access (and conditional assignment) in ES6/2015
- using brackets with javascript import syntax
- ES6 variable import name in node.js?
- Create object from array
- How to generate range of numbers from 0 to n in ES2015 only?
- Error Duplicate Const Declaration in Switch Case Statement
- ES6 Dynamic class names
- Is there a way to tell if an ES6 promise is fulfilled/rejected/resolved? [duplicate]
- What does this `…${…}…` code in the node docs mean? [duplicate]
- Unexpected comma using map()
- What happens if you don’t resolve or reject a promise?