How Can I Call A Template Literal Tag Function On A Regular String?
If I have a template literal tag function foo, which let's me do: const fooTaggedText = foo`some text`; is it possible for me to somehow call that tag on a regular string? For in
I'm not sure if I got it, but wouldn't this work?
consttaggedText = str => foo`${str}`;
So you'd use it like:
taggedText('my string')
// foo`my string`
Please give some rep if it helps :)
You may like these posts
Post a Comment for "How Can I Call A Template Literal Tag Function On A Regular String?"