Jump to: navigation, search

JQuery Array to string with toString

From w3cyberlearnings

Contents

jQuery toString

Returns string from array and uses comma to separate each array element.

Syntax

  array.toString();

Example TRY-IT

$(document).ready(function() {
	var myFruits='Apple Banana Coconut Mango Pear Orange';
	var myFruitsArray = myFruits.split(' ');
	alert(myFruitsArray.toString());
});

Output

Apple,Banana,Coconut,Mango,Pear,Orange

Related Links


Navigation
Web
SQL
MISC
References