You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates a new array where each element is initialized with the `Ok`
159
+
result value of an initializer function. The initializer is called with the
160
+
index of each element, and returns the new array if all calls to the
161
+
initializer succeed or the first error otherwise.
162
+
163
+
Parameters:
164
+
165
+
|param|type|description|
166
+
|-----|----|-----------|
167
+
|`length`|`Number`|The length of the new array|
168
+
|`fn`|`Number => Result<a, b>`|The initializer function to call with each index, where the `Ok` value returned will be used to initialize each element|
169
+
170
+
Returns:
171
+
172
+
|type|description|
173
+
|----|-----------|
174
+
|`Result<Array<a>, b>`|`Ok(array)` if all elements were successfully initialized or `Err(error)` if the initializer function returned an error|
0 commit comments