In this Tutorial we want to describe you a code that help you in understanding JavaScript array map.
JavaScript array map
In this Tutorial we want to describe you a code that help you in understanding JavaScript array map. For this we are using a JavaScript language as script language. The function name functionmakeplural accept single as parameter variable, the variable single accept the list of value and store in it. Finally the document .write ( ) method print all the list of element in a singular form. The for loop evaluate the length of the element in singular form and the document. write print the length of element. The Single variable map the singular element to plural and store in variable plural. The document.write print the element in plural form. The for loop return you the number of times your script runs and the length of the plural element in the list printed by the docment.write ( ) method.
Arraymap.html
<html>
|
Output of the program