Syntax Of Lodash join method
_.join(array, [separator=','])
The lodash join method converts all elements in the array into a string separated by a separator.
Arguments
- array (Array) − The array to convert.
- [separator=’,’] (string) − The element separator.
Output
- (string) − Returns the joined string.
Example
var _ = require('lodash'); var list = [1, 2, 3, 4, 5, 6]; var result = _.join(list,'~') console.log(result);
Save the above program in tester.js. Run the following command to execute this program.
Command
\>node tester.js
Output
1~2~3~4~5~6
Next Topic – Click Here
Pingback: Lodash - intersection With methods - Adglob Infosystem Pvt Ltd
Major thankies for the article post. Really Great.