Closed evilpie closed 6 years ago
Okay, it makes sense to be as lazy as possible in the case where we wouldn't want to flatten any further anyway. Previously, I was looking for some kind of consistency with always observing each element, but I don't really see that anymore. PR incoming.
@anba already brought this up in #49. I just want to get this to your attention again and we can ask the editor if necessary.
Because the way Array#flatten and Array#flatMap work is a bit different, an optimized version of FlattenIntoArray just for flatMap looks like this: