Untitled

 avatar
unknown
plain_text
3 years ago
409 B
5
Indexable
String.prototype.externalStringLiterals = async (correspondingStrings) => {let g = () => new Promise((finish) => {
    let templateString = this
    let templates = this.match(/\{.}/g)
    templates.forEach((str,index) => {
        templateString = templateString.replace(str,correspondingStrings[index])
        index >= templates.length-1 ? finish(templateString) : ''
    })
})
let h = await g()
return h
}
Editor is loading...