Functional JavaScript Programming 9 - Map( ) Method (WITH EXAMPLE)

Опубликовано: 21 Октябрь 2024
на канале: Rocky DeRaze
158
2

Best book for Functional Programming in JS - https://www.amazon.com/Functional-Pro...

What is Map( ) Method in JavaScript?
How to get started in Functional Programming on JavaScript?

In this video tutorial, I talk about the basics of Functional Programming by bringing in the Map( ) Method. What is it? Find out in the video.

MAP( ) FUNCTION
===============

1. A new array is created
2. Takes three arguments - Array, Index, Value
3. The old array is kept as it is
4. The map method calls the function once per each element in the array, according to the order
5. Thus, the function is applied to EVERY element
6. The results are ALWAYS printed out in a new array
7. myArray.map(myFunction);
8. Map is defined as an Array Method
9. The function that is taken as an argument by map is a callback function, as discussed in the previous videos
10. Very useful concept to master, used widely in the functional programming paradigm

Code File - https://jsfiddle.net/rockyderaze/tyx7...
JSFiddle - https://jsfiddle.net/

Map( ) Method in Functional JavaScript Programming by Rocky DeRaze (WITH EXAMPLE)