Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
JavaScriptのテンプレートリテラル / Template Literal of JavaScript
Search
ygkn
June 20, 2019
Programming
0
79
JavaScriptのテンプレートリテラル / Template Literal of JavaScript
ygkn
June 20, 2019
Tweet
Share
More Decks by ygkn
See All by ygkn
カラースキームつくったよ / How to create color-scheme
ygkn
0
170
入門 React Hooks / Introduction of React Hooks
ygkn
0
180
Other Decks in Programming
See All in Programming
What We Can Learn From OSS
inouehi
0
430
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
240
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
220
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
2
130
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
19k
GitLab CI/CD で C#/WPFアプリケーションのテストとインストーラーのビルド・デプロイを自動化する
hacarus
0
150
AmperとFleetを使ったAndroidアプリ
yoppie
0
250
AppRouter Panel Talk
yosuke_furukawa
PRO
1
460
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
140
SIMD Parallel Programming with the Vector API
josepaumard
0
230
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
670
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
420
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
21
1.4k
The MySQL Ecosystem @ GitHub 2015
samlambert
244
12k
YesSQL, Process and Tooling at Scale
rocio
165
13k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
What's in a price? How to price your products and services
michaelherold
238
11k
Done Done
chrislema
178
15k
Designing for humans not robots
tammielis
248
25k
Building an army of robots
kneath
300
41k
A designer walks into a library…
pauljervisheath
201
23k
A Modern Web Designer's Workflow
chriscoyier
689
190k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
How GitHub (no longer) Works
holman
305
140k
Transcript
JavaScript の テンプレートリテラル やぎちゃん
自己紹介
文字をくっつけよう!
文字をくっつけよう!
もじぴったん
None
+演算子のなところ 加算?結合?
+演算子のなところ 加算?結合?
+演算子のなところ 加算?結合?
文字列の結合?
テンプレートリテラルで書く
さっきの
テンプレートリテラルで書く
テンプレートリテラルで書く
One more thing...
None
None
None
None
None
とはならない!
None
これ is 何?
None
これ is 何? タグ付きテンプレート文字列 →テンプレートリテラルで書かれた文字列(の配列)と埋め込まれた変数を受け取る関 数
タグ付きテンプレート文字列の例 (from MDN)
None
None
None
タグ付きテンプレート文字列と @emotion/styled (styled-componentsも可)
Styled Components?
Styled Components?
Styled Components? 一種のHOC
Styled Components?
Styled Components?
まとめ!!! • テンプレートリテラルは文字の連結だけじゃないよ! • 文字列と埋め込む変数を別々に関数に渡すのでいろいろできるよ!! • ↑の例として SQL や CSS
in JS のライブラリがあるよ!!!
ありがとうございました!