Skip to content

Back to Snippets

bareTag()

A tag function for template literals that works as if the template was untagged.

function bareTag(strings, ...values) {
return String.raw({ raw: strings }, ...values);
}

Usage

const name = 'Dan';

`My name is ${name}.`;
// My name is Dan.

bareTag`My name is ${name}.`;
// My name is Dan.