document.writeln(my_array); } Javascript Data types . A heterogeneous array is the opposite to a homogeneous array.
The Array in JavaScript is a global object which contains a list of items. When you want to handle a collection of the same data type, you'll want to create an array. document.writeln(array_result); An array is a single variable in JavaScript that is used to store various elements. But in JavaScript, arrays can have elements of different types. var my_array=["Dhoni","Sachin","Kohli","Rohit","Dhawan"]; var array_result=my_array.includes("Sachin"); The sort() method is used to display the array elements in ascending order.
my_array.push("Srilanka"); Usings arrays, you can store numbers, strings, objects, even other arrays, inside a single variable. Arrays are special kinds of objects.