join() is an array function from Node.js that is used to return a string from the array.
Syntax:
array_name.join(parameter)
Parameter: This function takes a single parameter as per which the join operation has to be performed.
Return type: The function returns the string.
The program below demonstrates the working of the function:
Program 1:
function joinDemo() { var str= arr.join("*"); console.log(str); } var arr=[17, 55, 87, 49, 78]; joinDemo(); |
chevron_right
filter_none
Output:
17*55*87*49*78
Program 2:
function joinDemo() { var str= arr.join(""); var str1= arr.join("$"); console.log(str); console.log(str1); } var arr=['C','Java','Python']; joinDemo(); |
chevron_right
filter_none
Output:
CJavaPython C$Java$Python
Recommended Posts:
- Nodejs | Automatic restart NodeJs server with nodemon
- Nodejs | GM charcoal() Function
- Nodejs | GM blur() Function
- Nodejs | GM sharpen() Function
- Nodejs | GM drawLine() Function
- Nodejs | GM drawArc() Function
- Nodejs | GM drawPolyline() Function
- Nodejs | GM drawBezier() Function
- Nodejs | GM drawCircle() Function
- Nodejs | GM drawEllipse() Function
- Nodejs | GM drawPolygon() Function
- Nodejs | GM drawRectangle() Function
- Nodejs | GM paint() Function
- Nodejs | GM orderedDither() Function
- Nodejs | GM roll() Function
- Nodejs | GM segment() Function
- Nodejs | GM quality() Function
- Nodejs | GM raise() Function
- Nodejs | GM resize() Function
- Nodejs | GM transparent() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

