Iterate through a string character by character - Node.js String

Node.js examples for String:Char

Description

Iterate through a string character by character

Demo Code

String.prototype.forEach = function (call) {
    for (var i = 0; i < this.length; i++) {
        call(this[i]);//from ww  w . j a  va2  s .  c o  m
    }
};

Related Tutorials