The map() operator is common when working with arrays or any other kinds of sequences in functional languages and frameworks. In JavaScript, array objects have a method called map(). This method is available in all modern browsers now.
The map() operator calls the provided function once for each element in the Observable. This function takes the object in the Observable as input and returns another object. So the Observable returned by the map() operator will propagate the result of calling the map function for each element of the original Observable.
The provided function is called as soon as the object is propagated by the original Observable; it is called in the same order.
So the map() operator has the following signature:
observable.map(mapFunction,[thisContext]);
The first parameter is mandatory and the second is optional:
- mapFunction: This is a function that takes an element of the observable...