Notifications
Clear all
Topic starter
15/10/2021 6:24 pm
join() method in javascript used to convert an array to a comma-separated string.
var array=["Sam","Tony","Sunny","Federal"]; array.join();
output:
"Sam,Tony,Sunny,Federal"
default it will take comm value.
array.join(' and ')
we can add custom string
Output:
"Sam and Tony and Sunny and Federal"