From the course: Learning Functional Programming with Swift

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Working with arrays "functionally"

Working with arrays "functionally" - Swift Tutorial

From the course: Learning Functional Programming with Swift

Start my 1-month free trial

Working with arrays "functionally"

- [Instructor] One of the places where the functional programming paradigm really shines through, and one of the reasons it's started to gain a following in the programming community, is the ease with which it allows us to work with arrays. There's an inherent difficulty in working with arrays using for loops and many programmers probably remember trying to track down off by one errors and other such hard to find bugs. The fact is, as central as they've been to programming over the past few decades, there are many places where for loops are more a necessary evil than they are a valued part a code base. Fortunately for us, now that we've got a basic understanding of the fundamental concepts of functional programming and how they're expressed in code, we're ready to learn a better way to work with arrays. A way that allows us to code more like we think without having to worry about array links and indices and all the individual steps required along the way. In Swift, arrays have several…

Contents