Apply string format to all elements of array and return result - Node.js String

Node.js examples for String:Format

Description

Apply string format to all elements of array and return result

Demo Code

Array.prototype.format=function(prefix)
{
    var result = [];
    this.forEach(function(entry) {
        result.push(prefix.format(entry));
    });/*ww w.j a va  2s. c o  m*/
    return result;
};

Related Tutorials