- Read Tutorial
- Watch Guide Video
- Complete the Exercise
Summary
Alter a method that maps over a large range of data so that it does not timeout.
Exercise Description
The following integer 1,000,000,000,000,000,000
crashes the method that attempts to map over it and calculate the square value of the first 5 elements. Update the method so that it can still take in the large number as an argument, but it only focuses on processing the first 5 elements. Also, you can't simply shrink the value down to 5.
Real World Usage
Working with large data sets is important for many different applications, including web apps and machine learning algorithms. This exercise specifically focuses on understanding how enumerable methods work and the difference between eager and lazy loading.