Untitled

 avatar
unknown
javascript
3 years ago
435 B
28
Indexable
String.prototype.externalStringLiterals = async function(correspondingStrings){let g = () => new Promise((finish) => {
    let templateString = this
    let templates = templateString.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...