Array values you can access by array indexing. Index value 0, starting from the first value of the array.
List of array values that are separated by comma and must have to belong between opening and closing bracket.
Notes : Array use numeric indexes where as Object use numeric as well as string name. In the next lesson, we will learn more about Object.
Array syntax has three different forms, you can use any one to create an Array.
Create an array :
Array Literal Method : You can use the array literal method to create an array. Specifies an array items, and assign to a variable.
An array literal method to create an array and execute very quickly.
Avoid using the built-in array constructor method, use the array literal method would be good.
Find the length of Array :
If you call an array constructor without any arguments, an array length set to zero.
Access an array elements : Access selected elements of an array, use indexing. Index value 0, starting from the first value of the array.
Looping through access array element : A for statement iterates over of an array,
for (variable in object) statement : You can also use for..in statement to iterates over of an array,
Change the value in an array list : You can modify/reassign the values of an array element using element index,
Delete an array element : The delete statement to delete an array element from an array. Actually deleted statement not delete an array element, is just set undefined.
delete statement is not perfect for removing completely, you have to use splice() method.