Skip to content

Instantly share code, notes, and snippets.

@petekp petekp/taggify.js
Last active Oct 18, 2015

Embed
What would you like to do?
Wrap all characters in a string with any XHTML tag (ES6, lodash)
taggify(string, tag) {
let taggedChars = []
_.map(string, function(char) {
taggedChars.push(`<${tag}>${char}</${tag}>`)
})
return taggedChars.join('')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.