An array is a special kind of object. You will be performing a certain test on an original array and the elements that pass this test will be returned to the new array using this method. Converting … The literal notation array makes it simple to create arrays in JavaScript. It comprises of two square brackets that wrap optional, comma-separated array elements. It returns true if condition matches given condition otherwise returns false. object. var num = [10, 20, 30]; 2. They are widely used in modern Javascript to copy data also. document.getElementById("myarray").innerHTML = my_array; document.writeln("Remaining elements of array: "+ my_array); For typed arrays, the constructor dictates what the format is. var num; This statement changes the value of the first element in cars: With JavaScript, the full array can be accessed by referring to the array document.write("Concatenated Result : " + concat_res ); But sometimes we need an ordered collection, where we have to store 1st, 2nd, 3rd element and many more. var array_result=my_array.slice(2,3); }