Ads Top

What is map in javascript?

Map example in javascript:
Map() method needs a callback function or object. It's return value in the array. It works with value if you don't have value then it does not work. Also, this method maintains value of the original array.  This example created a new array Or you can send dynamic value. Then I have used map with this new array, here I have passed a function getMap(), then the result will be shown as below:
<h3><b>Your Result:</b></h3>

                var numericArray = ["abc""Hello"124];
                var newArrValue =
                function getMap(num) {
                  return num + ': ';
Result will be:

No comments:

Note: Only a member of this blog may post a comment.

Copyright Reserved to Anything Learn. Powered by Blogger.