Content-type: text/html Downes.ca ~ Stephen's Web ~ Template Literals

Stephen Downes

Knowledge, Learning, Community

So I just learned about template literals in Javascript. I know, I know, they've been around since 2016. But I only came across them today as a consequence of rebuilding the gRSShopper aggregator (lots of updates coming to the repository shortly). What's interesting is not just what I learned but how I learned. I was writing code to convert JSON-encoded data from my API to HTML text I could display on a web page. As I edited the script, Visual Studio Code offered to refactor my code to use Javascript templating. "What?" I wondered, tried the refactoring, then started searching to figure out just what was happening here. I did not find a lot, but I found enough to let me try it out myself and make it work. I this this is a very satisfactory outcome, and the combination of performance support plus online resource really worked for me this time.

Today: 2 Total: 1120 [Direct link] [Share]


Stephen Downes Stephen Downes, Casselman, Canada
stephen@downes.ca

Copyright 2024
Last Updated: Apr 25, 2024 04:39 a.m.

Canadian Flag Creative Commons License.

Force:yes