DEV Community 👩‍💻👨‍💻

Discussion on: Fake tagged template string literal to enable syntax highlighting in VSCode

iamarsenibragimov profile image
Arsen Ibragimov

Could you please explain what this line of code means?

const lit = (s: TemplateStringsArray, ...args: any[]) =>, i) => ${ss}${args[i] || ''}).join('')

patarapolw profile image
Pacharapol Withayasakpunt Author • Edited on

It's literally what template string tags are -- functions.

You have to try this in your console.

function foo(...args) {


I get


The first arg is always an array of strings, and the latter args are objects, in their native form.