Untitled

Anonymous
javascript
07/01/2022 4:11 AM
580 B
61
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...