const arr = ["This", "is", "Programming", "world"];
// Join using -
const str = _.join(arr, '-');
// => This-is-Programming-world
// Join using space
const str_2 = _.join(arr, ' ');
// => This is Programming world
Syntax
_.join(Array, Seperator=',')
Parameters description
Array: [Required] The input array that contains values that need to be joined together with some seperator.
Seperator: [Optional] The seperator value that will join the array elements. The default value of Seperator is ',' means if you do not pass its value, it will separate the array values with commas.
Example Demo
0 Comments