Nodejs Utililty Methods String Filter

List of utility methods to do String Filter

Description

The list of methods to do String Filter are organized into topic(s).

Method

filter(f)
String.prototype.filter = function(f) {
  return this.split("").filter(f).join("");
};
filter(func)
String.prototype.filter = function(func) {
  str = this.split("");
  var ans = [];
  str.forEach(function(x) {
    if (func(x)) {
      ans.push(x);
    };
  });
  return ans;
...