Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Node v6 with ES2015
Search
Pine Mizune
June 03, 2016
Programming
1
820
Node v6 with ES2015
Gotanda.js #4 in Retty で発表した資料
http://gotandajs.connpass.com/event/30961/
Pine Mizune
June 03, 2016
Tweet
Share
More Decks by Pine Mizune
See All by Pine Mizune
多言語対応と絵文字ジェネレーター / i18n of Emoji Generator
pine
0
840
C++ 製グラフィックライブラリ Skia の紹介 / Introduction to the graphics library Skia written by C++
pine
0
1.8k
asyncio + aiohttp で作るウェブサービス / How to develop a web service with asyncio and aiohttp
pine
0
680
Lerna による明示的疎結合アーキテクチャ
pine
1
650
CircleCI 2.0 x JavaScript
pine
3
560
Perl 卒業式
pine
0
350
Android Studio の気になる warnings を抑制する方法まとめ
pine
0
510
Emoji Generator meets Browser Extensions
pine
1
3k
近年の OSS 開発における CI 選択のベストプラクティス
pine
3
4.5k
Other Decks in Programming
See All in Programming
Github Copilotのチャット履歴ビューワーを作りました~WPF、dotnet10もあるよ~ #clrh111
katsuyuzu
0
110
DSPy Meetup Tokyo #1 - はじめてのDSPy
masahiro_nishimi
1
170
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
38
26k
テストやOSS開発に役立つSetup PHP Action
matsuo_atsushi
0
150
connect-python: convenient protobuf RPC for Python
anuraaga
0
410
AIコーディングエージェント(NotebookLM)
kondai24
0
190
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
2.6k
How Software Deployment tools have changed in the past 20 years
geshan
0
29k
Findy AI+の開発、運用におけるMCP活用事例
starfish719
0
360
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
130
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
3
720
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
380
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
970
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
How to Ace a Technical Interview
jacobian
280
24k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Designing for Performance
lara
610
69k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
70k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
4 Signs Your Business is Dying
shpigford
186
22k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
[SF Ruby Conf 2025] Rails X
palkan
0
520
Transcript
3 Jun, 2016 / Gotanda.js #4 in Retty Pine Mizune
Node v6 with ES2015
Profile o GitHub: @pine o Twitter: @pine613 o 好きな言語: JavaScript
o 仕事で書いている言語: Kotlin / Perl o Mobile Factory, Inc
Table of contents uNode v6 released uDestructuring assignment (分割代入) uDefault
parameters uRest parameters (残余引数) uProxy API uReflect API Node v6 ~ 対応
Table of contents uNode v6 released uDestructuring assignment (分割代入) uDefault
parameters uRest parameters (残余引数) uProxy API uReflect API Node v6 ~ 対応
Node v6 released [1/4] 04/26 次期 LTS 候補 Node v6
リリース • 2013/03/11 Node v0.10.0 released • 2015/02/06 Node v0.12.0 released • 2015/09/08 Node v4.0.0 released (LTS) • 2015/10/29 Node v5.0.0 released • 2016/04/26 Node v6.0.0 released (次期 LTS) 今日はこの話
Node v6 released [2/4] 04/26 次期 LTS 候補 Node v6
リリース Node v0.10.x / v0.12.x は 2016 年中でサポート切れ
Node v6 released [3/4] 04/26 次期 LTS 候補 Node v6
リリース Node v4.x (LTS) は 2018 年春までサポート
Node v6 released [4/4] 04/26 次期 LTS 候補 Node v6
リリース Node v6.x なら ES2015 が ほぼトランスパイル不要
Table of contents uNode v6 released uDestructuring assignment (分割代入) uDefault
parameters uRest parameters (残余引数) uProxy API uReflect API Node v6 ~ 対応
Destructuring assignment (分割代入) [1/3] 配列、オブジェクトの代入を簡潔に記述する構文 let [ first, second ]
= [ 1, 2 ] console.log(first, second) #=> 1 2 let { name, age } = { name: “rem”, age: 17 } console.log(name, age) #=> rem 17 配列での分割代入 オブジェクトでの分割代入
Destructuring assignment (分割代入) [2/3] 関数の引数でも、分割代入が可能 function foo({ flag = false
} = {}) { console.log(flag) } foo() #=> false foo({ flag: true }) #=> true オプションを受け取る関数が、簡潔に定義可能 呼び出す側は今まで通り
Destructuring assignment (分割代入) [3/3] require / import 文で使うと綺麗 const {assign}
= require(‘lodash’) import/export は Node v6 では非対応、要 Babel require での記述が簡略化可能 import {exec} from ‘child_process’
Default parameters 関数の引数に初期値が設定可能 function foo(a = 1, b, c =
3) { console.log(a, b, c) } 任意の箇所の引数の初期値が指定可能 foo() #=> 1 undefined 3 foo(1, 2, 3) #=> 1 2 3 初期値を指定しない場合は従来通り undefined
Rest parameters (残余引数) 可変長引数を簡潔に記述可能 function foo(a, b, …args) { console.log(a,
b, args) } 任意の箇所の引数の初期値が指定可能 foo(1, 2) #=> 1 2 [] foo(1, 2, 3, 4, 5) #=> 1 2 [ 3, 4, 5 ] arguments と違い本物の配列として扱える
Proxy API [1/2] プロパティアクセスや演算子の処理を上書きする機能 const target = { foo: ‘foo’
} const proxy = new Proxy(target, { get(target, name) { return ‘bar’ } }) プロパティアクセスを上書きする場合 console.log(target.foo) #=> foo console.log(proxy.foo) #=> bar Proxy 経由でのアクセスのみ上書きされる ※ Babel 未対応
Proxy API [2/2] Proxy API で上書き可能な処理な例 名前 上書きできる処理 get obj[‘key’]
set obj[‘key’] = value has ’key’ in obj apply obj() constructor new obj() enumerate for (var key in obj) { ... }
Reflect API Proxy の各処理に対応する関数を提供する API const target = { foo:
‘foo’ } const proxy = new Proxy(target, { get(target, name) { return Reflect.get(target, name) } }) Proxy とセットで用いると有用 console.log(target.foo) #=> foo console.log(proxy.foo) #=> foo Proxy から本来の処理に移譲できている
Fin. ALLPPT.com _ Free PowerPoint Templates, Diagrams and Charts