tc39 / proposal-flatMap

proposal for flatten and flatMap on arrays
https://tc39.github.io/proposal-flatMap
214 stars 19 forks source link

replace IsConcatSpreadable with IsArray #38

Closed michaelficarra closed 6 years ago

michaelficarra commented 6 years ago

/cc @domenic

bterlson commented 6 years ago

LGTM. It doesn't address possible ergonomic issues with node lists and etc. (nor does it offer a way for such objects to opt-in to flattening), but as discussed this seems fine and possibly good.

ljharb commented 6 years ago

I'm not comfortable with this; I would expect it to work with array-likes. Am I forced to slice it first, unlike all other array methods?

domenic commented 6 years ago

It didn't work with array-likes before.

If it works with array-likes, it works with strings, which is kinda bad.

ljharb commented 6 years ago

That is a very fair point. Sounds good, withdrawn.