Skip to Content
Mastering JavaScript Functional Programming
book

Mastering JavaScript Functional Programming

by Federico Kereki
November 2017
Intermediate to advanced
386 pages
9h 22m
English
Packt Publishing
Content preview from Mastering JavaScript Functional Programming

Applying an operation - map

Processing lists of elements, and applying some kind of operation to each of them, is a quite common pattern in computer programming. Writing loops that systematically go through all the elements of an array or collection, starting at the first and looping until finishing with the last, and doing some kind of process to each of them, is a basic coding exercise, usually learned in the first days of all programming courses. We already saw one such kind of operation in the previous section, with .reduce() and .reduceRight(); let's now turn a new one, called .map().

In mathematics, a map is a transformation of elements from a domain into elements of a codomain. For example, you might transform numbers into strings, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering JavaScript Functional Programming - Second Edition

Mastering JavaScript Functional Programming - Second Edition

Federico Kereki

Publisher Resources

ISBN: 9781787287440Supplemental Content