Array.from #1966
Labels
Comments
It required function overloading due to Array.from has different signatures with different arity: from<T>(arrayLike: ArrayLike<T>): T[];
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: i32) => U, thisArg?: any): U[];and should support also this: Array.from({ length: 128 }) // ArrayLike interface required only "length" |
|
I think we can at least have a subset of the functionality. It would be nice for easy cloning at least. Wdyt? |
|
@MaxGraey This could currently be handled with defaults, except for the from<T, U = T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: i32) => U = (t: T, k: i32) => t): U[]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Seems like a
good first issue, if I'm not underestimating it. (Mind marking it with that label?)The text was updated successfully, but these errors were encountered: