Creates a new array with length elements. Element values are determined
by a function f of the element index. Returns null for invalid lengths
(non-integer or negative). createWith also treats a length greater than maxLength as
invalid, to prevent errors that could halt the interface, use excessive memory,
etc. If you truly intend to create a very long array, you may set maxLength
to a value higher than the default of 10000 to accommodate this need.
Remarks
Note that as an array creation function, createWith is one of the few
functions in this module that neither takes an array as an argument nor
returns such a function.
Creates a new array with
lengthelements. Element values are determined by a functionfof the element index. Returnsnullfor invalid lengths (non-integer or negative).createWithalso treats alengthgreater thanmaxLengthas invalid, to prevent errors that could halt the interface, use excessive memory, etc. If you truly intend to create a very long array, you may setmaxLengthto a value higher than the default of 10000 to accommodate this need.Remarks
Note that as an array creation function,
createWithis one of the few functions in this module that neither takes an array as an argument nor returns such a function.Example