Nodejs String Filter filter(f)

Here you can find the source of filter(f)

Method Source Code

String.prototype.filter = function(f) {
  return this.split("").filter(f).join("");
};

Related

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