src/helper.js
function (glue, pieces) {

            var retVal = "",
                tGlue  = "";

            if (arguments.length === 1) {
                pieces = glue;
                glue   = "";
            }

            if (typeof pieces === "object") {
                if ($this.type(pieces) === "array") {
                    return pieces.join(glue);
                }

                $this.each(pieces, function (i) {
                    retVal += tGlue + pieces[i];
                    tGlue = glue;
                });

                return retVal;
            }
        }
function (glue, pieces) {

            var retVal = "",
                tGlue  = "";

            if (arguments.length === 1) {
                pieces = glue;
                glue   = "";
            }

            if (typeof pieces === "object") {
                if ($this.type(pieces) === "array") {
                    return pieces.join(glue);
                }

                $this.each(pieces, function (i) {
                    retVal += tGlue + pieces[i];
                    tGlue = glue;
                });

                return retVal;
            }
        }
function ( glue , pieces ) { var retVal = "" , tGlue = "" ; if ( arguments . length === 1 ) { pieces = glue ; glue = "" ; } if ( typeof pieces === "object" ) { if ( $this . type ( pieces ) === "array" ) { return pieces . join ( glue ) ; } $this . each ( pieces , function ( i ) { retVal += tGlue + pieces [ i ] ; tGlue = glue ; } ) ; return retVal ; } }
Join array elements with a string

@link http://php.net/manual/en/function.implode.php
@link http://phpjs.org/functions/implode/

@param glue
@param pieces
@returns {*}
Join array elements with a string