|
|
|
|
|
by Scriptor
3426 days ago
|
|
You can hide a loop behind a function call in Go, Python, really any imperative language. What makes map different is that it separates the looping mechanics (incrementing, initializing and appending to the collection) from the actual computation we want to perform on each element. It's just separation of concerns. |
|
You're right: map separates looping mechanics from computation. In Go, that's a bit too much obscurity.