Template Literals
In a tagged template, what is the structure of the first argument passed to the tag function?
In a tagged template, the first argument passed to the tag function is an array of the string literals from the template. This array contains the string parts of the template, split at each ${} expression. If there are n expressions in the template, this array will contain n+1 strings (potentially empty strings if an expression appears at the beginning or end, or if two expressions are adjacent). This array also has a special property called 'raw', which is another array containing the raw string literals before processing escape sequences. The remaining arguments to the tag function are the evaluated results of each interpolated expression in the order they appear. This structure gives the tag function complete access to both the static text and the dynamic values, allowing for sophisticated template processing.