-
-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Destructuring #113
Labels
Comments
Destructuringは異様に複雑なことも書けるので、ほどほどというものを上手く言葉にまとめたい感じ。
以前、仕様の議論でも以下のはOKなの?とか色々話がでていたので、特殊な使い方より普通の人が普通に使うパターンについて解説したい var obj = {};
let { } = obj; |
他の言語では多重代入と言われてたりする。 |
C++だとC++17に提案されている |
|
📝 |
This was referenced Dec 16, 2018
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#17 基本文法
Destructuringについて扱う。
Destructuringは他と組み合わせ使う傾向があるけど、一見するとよくわからないものなので一つの文法として紹介した方が良さそう。Promise.all
など色々あるが、基本的な配列とオブジェクトの2種類を紹介する形にする。
追記: 2018-12-16
=
で紹介するという程度に留めておく。
目的
分割代入(Destructuring assignment)という構文の名前を知ること。
初めてみたときこの構文は混乱するので、この名前を知っていればあとはMDNなど色々なリソースでより詳細な構文を知ることができるという点を目的としている。 分割代入(Destructuring assignment)をすべて解説しないで、最低限(オブジェクト、配列、関数)だけに絞ってははなす。
オブジェクトについては、モジュールでも同じような構文となるため目に慣れておいて欲しいという点も含めて何箇所かにだしている。
Tasks
=
で紹介const [a, b] = [1, 2]
を紹介 配列、オブジェクト、関数の仮引数における分割代入についてを追加 #593const {a, b} = { a: 1, b: 2 }
を紹介 配列、オブジェクト、関数の仮引数における分割代入についてを追加 #593Object.entries({}).map(([key, value]) => {})
The text was updated successfully, but these errors were encountered: