1. Computing

Discuss in my forum

Michael Morin

Why Does 'map' Return an Array?

By , About.com GuideJuly 24, 2012

Follow me on:

Why does the 'map' method always return an Array?  It doesn't matter what you call it on, even for Hashes and subclasses of Array, the 'map' method always returns a plain Array?  Why?

This has to do with how 'map' is implemented, the Enumberable module and mixin modules in general.

Comments
No comments yet. Leave a Comment
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>
Top Related Searches array map

©2013 About.com. All rights reserved.