Nodejs Array Join join(separator)

Here you can find the source of join(separator)

Method Source Code

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];
   }/* www .j ava2s . co  m*/
   
   return s;
};

Related

  1. join()
    function foo(arr)
        var o2 = o;
        var y = 100;
        for (var i =0;i<10;i++)
            y += o2.x + arr;
        WScript.Echo(y);
    ...
    
  2. 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;
    ...
    
  3. 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]);
    ...