Closed
Description
From readme Generic factory method:
fromAsync can be transferred to or inherited by any other constructor with a single numeric parameter. In that case, the final result will be the data structure created by that constructor (with 0 as its argument)...
While species and of()
create arrays with a numeric argument, presumably since they'd be able to have knowledge of predetermined length, shouldn't fromAsync()
be consistent with from()
since the length of the iterable would/could be unknown?
class Custom extends Array {
constructor (length) {
super()
console.log('Argument length:', length)
}
}
Custom.from([1,2,3]) // Argument length: undefined