Top 1,000 Features Creators Resources Blog Explorer Download
GitHub icon

Destructuring

< >
Example from 1 languages: undefined
const o = {p: 42, q: true}; const {p, q} = o;
Example from 1 languages: undefined
type person = {name: string, age: int}; let somePerson = {name: "Guy", age: 30}; let {name, age} = somePerson;
Example from 1 languages: undefined
{"list": [0] + rest} = {"list": [0, 1, 2, 3]}
Example from 1 languages: undefined
let add = fn ((a,b)) a + b let tuplify = fn (a,b) (a,b) return add(tuplify(1,2)) # 3
*

Languages with Destructuring include JavaScript, Reason, Coconut, bog

*

View all concepts with or missing a hasDestructuring measurement

*

Read more about Destructuring on the web: 1.

View source

- Build the next great programming language About Acknowledgements Extensions Day 631 Donate feedback@pldb.io