Tagged Template Literals

  Рет қаралды 3,241

Kent C. Dodds

Kent C. Dodds

Күн бұрын

What are Template literals and how do you write a tagged template function.
gist: gist.github.com/kentcdodds/aa...

Пікірлер: 6
@escapiststupor
@escapiststupor 6 жыл бұрын
Thank you Kent for these wonderful livestreaming!
@sikz26300
@sikz26300 5 жыл бұрын
Thanks for going over this, I'm still having trouble understanding why you'd want to go this route though. At least in the case of the translation example, I'd probably prefer doing something like: (user, language=language)=>{ //lang can be passed in or defaulted to browser/state or something else const {hello,yourBirthdayIs} = getTranslations(language); const {name,birthday} = user; return `${hello}${name}, ${yourBirthdayIs}${birthday}` } But maybe thats just this example, or maybe it just makes me feel dirty using string search to filter out my replacements.
@herrmosa918
@herrmosa918 5 жыл бұрын
Useful tutorial
@gosnooky
@gosnooky 10 ай бұрын
Reduce the interpolations always (since its length is always 1 fewer than the literals) interpolations.reduce((acc, current, i) => acc + current + literals[i + 1], literals[0]) More succinct this way.
@julianklumpers
@julianklumpers 6 жыл бұрын
What syntax theme are you using? Edit: found it already, its Nightowl. Nice video btw
@KentCDodds-vids
@KentCDodds-vids 6 жыл бұрын
kcd.im/mft
TypeScript Wizardry: Recursive Template Literals
14:47
Tech Talks with Simon
Рет қаралды 36 М.
Tagged Template Literals
11:11
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 10 М.
Did you believe it was real? #tiktok
00:25
Анастасия Тарасова
Рет қаралды 25 МЛН
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 14 МЛН
OMG🤪 #tiktok #shorts #potapova_blog
00:50
Potapova_blog
Рет қаралды 18 МЛН
Use React with an index.html and script tags
23:54
Kent C. Dodds
Рет қаралды 49 М.
Remix ➡️ React Router: What's going on?
1:00
Kent C. Dodds
Рет қаралды 2,1 М.
Tagged Template Literals JavaScript
10:48
techsith
Рет қаралды 9 М.
Template Literals (ES6) - Beau teaches JavaScript
9:43
freeCodeCamp.org
Рет қаралды 23 М.
Javascript Fetch API With CRUD operations
44:40
Cand Dev
Рет қаралды 63 М.
Use Maps more and Objects less
5:45
Steve (Builder.io)
Рет қаралды 88 М.
5 MORE Must Know JavaScript Features That Almost Nobody Knows
18:05
Web Dev Simplified
Рет қаралды 179 М.
I bet you haven't heard of this cool HTML tag & trick!
8:51
FollowAndrew
Рет қаралды 6 М.
cute mini iphone
0:34
승비니 Seungbini
Рет қаралды 6 МЛН
Как слушать музыку с помощью чека?
0:36
В России ускорили интернет в 1000 раз
0:18
Короче, новости
Рет қаралды 1,3 МЛН