8
u/PM_ME_A_WEBSITE_IDEA Oct 26 '20
Do people actually use the stringer constructor? If so, why?
1
u/MR_Coder Oct 27 '20
I feel like that’s the kind of code you see from those overseas outsource companies.
7
3
u/LazaroFilm Oct 26 '20
Back ticks for evaaaa! I love the use of `embed ${javaScript} in your string`
5
2
u/Harbltron Oct 26 '20
Didn't know that about Backticks, that's awesome!
Definitely less cumbersome than breaking-up strings into multiple concatenations.
2
u/Kesar13 Oct 26 '20
with the mention that you need backticks when you need a variable inside the string
i.e.: let variable = "string"
"this is a ${variable}" will log as"this is a ${variable}"
whilst
'this is a ${variable}' (read it as backtiks cant find it on mobile) will log as "this is a string"
3
1
1
u/ChuckItOver Oct 26 '20
Template literal tagged templates are cool too.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
0
Oct 26 '20
[deleted]
1
u/peawyoyoyin Oct 26 '20
template literals only refer to those literals using backticks, no?
1
u/b-mish Oct 26 '20
Comment redacted I was referring to the term template strings which are now referred to as template literals. I misread the slide.





47
u/MrMimmet Oct 26 '20
You should really avoid using 'var' to declare your variables.