Untitled

mail@pastecode.io avatar
unknown
javascript
2 years ago
435 B
19
Indexable
Never
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
}