Nodejs Utililty Methods Array Join

List of utility methods to do Array Join

Description

The list of methods to do Array Join are organized into topic(s).

Method

join()
function foo(arr)
    var o2 = o;
    var y = 100;
    for (var i =0;i<10;i++)
        y += o2.x + arr;
    WScript.Echo(y);
...
join(separator)
Array.prototype.join = function(separator) {
  var s = new String();
  for (var i = 0, len = this.length; i < len; i++) {
    s += (i > 0) ? separator : "";
    s += (typeof this[i] == "object" && this[i].constructor === Array) ? this[i].join(separator) : this[i];
  return s;
};
joinModel(id_app,model,joinFields,fn)
Array.prototype.joinModel = function(id_app,model,joinFields,fn){
  var array = this;  
  async.map(array,function(a,callback){
    async.map(joinFields,function(join,callback){
      var akey = join.akey;
      var bkey = join.bkey;
      var avalue = a[akey];
      var query = {id_app:id_app};
      query[bkey] = avalue;
...
joinsub(array, sizediff)
Array.prototype.joinsub = function (array, sizediff) {
  if (!array)
    return null;
  var match = [];
  for (var i = 0; i < this.length; i++) {
    if (this[i].contains(array, sizediff)) {
      for (var j = 0; j < this[i].length; j++) {
        if (array.indexOf(this[i][j]) == -1) {
            match.push(this[i][j]);
...