JavaScript TypedArray map() MethodThe JavaScript map() method form a new array creates a new typed array with the results of calling a provided function on every element in this typed array. NOTE: map() method does not change the actual array.Syntax:Parameters:Value(Required): The value of the current element. Index(Optional): The array index of the current element. arr(Optional): The array map() was called upon. ThisValue(Optional): A value to be passed to the function to be used as its "this" value. Return value:A new array. Browser Support:
Example 1JavaScript map() Method Test it NowOutput: 2,4,6 Example 2JavaScript map() Method Test it NowOutput: 10,1,3,5 Next TopicJavaScript TypedArray Object |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India