Lodash – join method

  • Post author:
  • Post category:Lodash
  • Post comments:2 Comments
Lodash - join method

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

This Post Has 2 Comments

  1. site

    Major thankies for the article post. Really Great.

Leave a Reply