code: function sanicJoin(array, separator = ',') {
      if (!(array instanceof Array)){
          throw new TypeError('array is not an Array');
      }
  
      if (!array.length){
          return '';
      }
  
      if (array.length === 1){
          return array[0];
      }
  
      let res = String(array[0]), i = 1;
      const iMax = array.length;
  
      for (; i < iMax; i++){
          res += separator + array[i];
      }
  
      return res;
  }
docs: Basic implementation