A few years ago I read somebody talking about the fact that templates can be used as an alternative function syntax. I found this quite funny. Why would anyone do this to save two characters?
It turns out, many things in JavaScript are already done with strings and the fact that these are string templates and not just plain strings makes them rather powerful and with Babel plugins they can be converted to regular function calls before hitting production.
Nice.
A few years ago I read somebody talking about the fact that templates can be used as an alternative function syntax. I found this quite funny. Why would anyone do this to save two characters?
It turns out, many things in JavaScript are already done with strings and the fact that these are string templates and not just plain strings makes them rather powerful and with Babel plugins they can be converted to regular function calls before hitting production.
I started a awesome list for this kind of stuff, maybe this will become more of a thing in the future :D
awesome-tagged-templates
Jest is using this in
each
See point 2:
jestjs.io/docs/en/api#testeachtabl...