Manipulating Data in Flight with map
Let's see how we can manipulate the data using the map operator and build our first observable for the stopwatch project.
We'll cover the following
Data manipulation in observables is one of the important tasks of RxJS. Right now, you have a collection of almost-right data that needs just one little tweak for it to be correct.
map
operator
Generally speaking, a map
function takes two parameters (a collection and another function), applies the function to each item, and returns a new collection containing the results.
A simple implementation looks something like this:
Get hands-on with 1400+ tech skills courses.