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
- Find Element in Array
- Get Array Size
- Eliminate Duplicate Array Element
- Loop through Array
- Turns Array to string