1089 0 0 0
Last Updated : 2025-04-28 22:44:54
Here are some of the most important and userd array functions and methods in Javascript.
Here are a list of the most important array methods in javascript.
Here is a samle of an array in Javascript
const names = ['Mohammed', 'Ahmed', 'Hassan', 'Nehad', 25, 'Ahmed'];
//ProtoType for this function , This will return the index if value is found or -1 other wise.
// You can check if element is found or not using if(index !== -1)
const index = Array.indexOf('value', startingPosition);
//To find the first index for Ahmed in this array
const index = data.indexOf('Ahmed')
//To find the last index for Ahmed
const index = data.lastIndexOf('Ahmed');?
Read Also