VOOZH about

URL: https://www.geeksforgeeks.org/javascript/collect-js-join-method/

⇱ Collect.js join() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Collect.js join() Method

Last Updated : 27 Nov, 2020

The join() method is used to join the collection elements with given string and returns the collection elements.

Syntax:

collect(array).join()

Parameters: The collect() method takes one argument that is converted into the collection and then join() method is applied on it.

Return Value: This method joins the collection elements with given string and returns the values.

Below example illustrate the join() method in collect.js:

Example 1:

Output:

10, 20, 30, 40, 50
a, b, c and d

Example 2:

Output:

Geeks, GFG, GeeksforGeeks
Comment
Article Tags: