THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS. document.writeln(my_array); OR var array_result=my_array.sort(); let car = cars.find(car => car.color === "red"); The variable ‘a’ refers to a single value in memory. Objects are not created for such use. But in JavaScript, arrays can have elements of different types. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy, JavaScript Training Program (39 Courses, 23 Projects, 4 Quizzes), 39 Online Courses | 23 Hands-on Projects | 225+ Hours | Verifiable Certificate of Completion | Lifetime Access | 4 Quizzes with Solutions, Angular JS Training Program (9 Courses, 7 Projects), Software Development Course - All in One Bundle. The forEach() method is used to invoke the function for each array element. You can also go through our other suggested articles to learn more, JavaScript Training Program (39 Courses, 23 Projects). Primitive data types are not mutable.
country[2] = "Srilanka"; We have an array of integers, boolean values or strings. The properties and methods of array objects help developers to handle arrays easily. An Array object is used to store a set of values in a single variable name. var array_result=my_array.slice(2,3);