Use of Array.toString() method in Javascript.

Rajesh_Kumar
Posted by Rajesh_Kumar under JavaScript category on | Points: 40 | Views : 537
The toString method Joins the array and returns one string containing each array element separated by commas.

function array_join_with_toString_method() 
{
var array_names = new Array(6);
array_names[0] = "Rajesh";
array_names[1] = "Kumar";
array_names[2] = "Sathua";
array_names[3] = "Vipin";
array_names[4] = "Seema";
array_names[5] = "Vinita";

var array_items = array_names.toString();
alert(array_items);
}

Comments or Responses

Login to post response