Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
モダンなJavaScriptを知ろう / modern JavaScript since E...
Search
Yutaro Shimoda
October 22, 2021
Programming
1.9k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
モダンなJavaScriptを知ろう / modern JavaScript since ES2015
ES2015の登場で大きな技術刷新があったJavaScriptの汎用性の高い機能をまとめました!
React/Next.jsでの開発でお世話になっています。
Yutaro Shimoda
October 22, 2021
More Decks by Yutaro Shimoda
See All by Yutaro Shimoda
PM Kansaiの紹介(デブサミ関西2026)
shimotaroo
0
74
職能の壁を取り払った先で見えた壁 -AI時代のクロスファンクショナル組織-
shimotaroo
1
350
AI時代のPMに求められるのは 「Ops」と「Enablement」
shimotaroo
1
1.3k
エンジニアの次のキャリアに プロダクトマネージャーという選択
shimotaroo
2
750
SNSは最強
shimotaroo
3
760
それ、プロダクトに機能追加しなくてもよくないっすか?
shimotaroo
0
420
イシューからはじめよう
shimotaroo
0
600
マーケ・セールス担当者の話を理解したいいいいい!!!
shimotaroo
0
1.3k
自分のペースで頑張ればいんじゃない?というお話
shimotaroo
0
1.9k
Other Decks in Programming
See All in Programming
Performance Optimization With LLMs
xleitix
0
190
sbt 2.0: takeoff
eed3si9n
0
170
[2026-10-14](C)Re:ゼロから始める異世界生活〜始まりの終わりと終わりの始まり〜
tosite
0
140
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
350
Simple Storage Service(S3) is not simple
iwatsukayura
0
310
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
150
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
160
APNsからLive Activityを開始する話
yumnumm
0
170
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
750
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
900
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
310
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
350
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
Technical Leadership for Architectural Decision Making
baasie
3
610
Un-Boring Meetings
codingconduct
0
460
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
760
Transcript
モダンなJavaScriptを知ろう 2021年10月22日
”モダン”なJavaScriptとは? この場では、 ES2015以降のJavaScript として扱います。
ES2015とは? • ECMA Internationalのもとで標準化されているJavaScriptの仕様 • ES2015 = ECMAScript2015 • ES2009→ES2015で大きな技術改訂があった
• 最新はES2020(最近は年1回のペースでリリース)
なぜこのテーマなの? React/Next.js開発でES2015以降の仕様のJSをゴリゴリ使っているから! (厳密にはTypeScriptですが...) • 既存のJavaScriptコードのリファクタリング • 知識のアップデート こんなことに活用してください
モダンなJavaScriptの機能 • Let、constによる変数宣言 • テンプレート文字列 • アロー関数 • 分割代入 •
スプレッド構文 • デフォルト引数 • map ※実際にはまだまだあります ... 例) Promise、async/await、filter、 オプショナルチェイニング、 null合体演算子などなど
let、constによる変数宣言(1) ✔ let、const、varの違い
let、constによる変数宣言(2) オブジェクト、配列はconstでも中身を変えることができる💡 ✔オブジェクト、配列は必ずconstで定義する
let、constによる変数宣言(3) varはwindowオブジェクトのプロパティを上書きしてしまう危険性がある😨 ✔ varは(絶対)使わない ✔ 基本はconst、どうしても必要な時だけletを使う
テンプレート文字列 ✔ ES2009以前 ✔ ES2015以降 バッククオートで囲む 変数は${ }で囲む
アロー関数(1) ✔ 通常の関数定義 functionでの宣言→ 無名関数を変数に格納→
アロー関数(2) ✔ アロー関数での関数定義 無名関数の省略記法 TypeScriptで型定義する場合は()は省略できない
アロー関数(3) 補足:返り値が1文の場合は{}だけでなくreturnも省略可能💡 ✔ React、Vue.jsではアロー関数がよく使われます。
分割代入(1) ✔ 通常のオブジェクトの展開 オブジェクト名.キー名 でプロパティの値を取得する
分割代入(2) ✔ 分割代入を使用 それぞれのプロパティの値が 格納される
スプレッド構文(1) ✏ オブジェクト、配列を扱うときに役立つ機能 ✔ 配列 ✔ 配列の展開、合体ができる
スプレッド構文(2) 関数の引数に配列を展開して設定できる💡
スプレッド構文(3) ✔ オブジェクト ✔ プロパティの上書きができる ✔ プロパティの追加もできる
デフォルト引数 通常の関数→ デフォルト引数使用→ 第2引数が必須ではなくなる
map(1) ✏ ES2015以降で一般的に使われる配列の繰り返し処理 ✔ JavaScriptで使用できる配列の繰り返し処理 • for • forEach •
for ~ of • map ← • filter for ~ of、forEachもmapと書き方が大きく変わらないけどそれぞれ違いがあります。 (今回は割愛)
map(2) 配列の要素を順番に処理して新たな配列を作成できる💡 numにarrの要素が順番に入る
map(2) 配列の要素を順番に処理して新たな配列を作成できる💡 第2引数にはインデックスが入る ✔ 引数の名前は任意 ✔ (もちろん)アロー関数が使える
ご清聴ありがとうございました 快適なフロントエンド開発を!