Files
lodash/join.js
John-David Dalton 6cb3460fce Remove semicolons.
2017-02-05 22:22:04 -08:00

22 lines
587 B
JavaScript

/* Built-in method references for those with the same name as other `lodash` methods. */
const nativeJoin = Array.prototype.join
/**
* Converts all elements in `array` into a string separated by `separator`.
*
* @since 4.0.0
* @category Array
* @param {Array} array The array to convert.
* @param {string} [separator=','] The element separator.
* @returns {string} Returns the joined string.
* @example
*
* join(['a', 'b', 'c'], '~')
* // => 'a~b~c'
*/
function join(array, separator) {
return array == null ? '' : nativeJoin.call(array, separator)
}
export default join