The join() method converts all the elements of an array to a joined string. This method is unlike the concat() method, which concatenates but does not perform any type conversions.
var friends = ["Net", "Giri", "Madhavi","Rekha", "chandra"] var friendsString = friends.join(); alert(friendsString);
OUTPUT: ======= Net,Giri,Madhavi,Rekha,chandra
The join() method lets you choose the delimiter, for example i am using @ symbol as below
var friends = ["Net", "Giri", "Madhavi","Rekha", "chandra"] var friendsString = friends.join("@"); alert(friendsString);
OUTPUT: ======= Net@Giri@Madhavi@Rekha@chandra
|
No responses found. Be the first to respond and make money from revenue sharing program.
|