In this Tutorial we want to describe you a code that help you in understanding JavaScript array for string, The code depicts that on loading a page invoke a function display ( ).
Javascript array for string
In this Tutorial we want to describe you a code that help you in understanding JavaScript array for string, The code depicts that on loading a page invoke a function display ( ). The function includes an array variable that is used to instantiate an array. The array object hold the different element specified by array index from [0] -[5].The for loop execute and run the script till the length i is less than the length of an array. The document. write print the element of the array that it hold.
Method used-
1)array.splice(1,2) - This method remove and insert an element of array. This method remove the element from an array index [1] and [2].
Finally the document. write print the list of element that an array object hold after delete an element from the element of an array.
function.html
|
Output
Download code