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
Converts an arbitrary {{link lang isSeq sequence}} to an array. Allows the following inputs:
1
+
Converts an arbitrary {{link lang isSeq sequence}} to an array. Supports the following inputs:
2
2
3
3
* {{link lang isNil Nil}}: return `[]`.
4
-
* {{link lang isArr Array}}: copy via `.slice()`.
4
+
* {{link lang isTrueArr Array}}: return as-is.
5
5
* {{link lang isList List}}: convert via `Array.prototype.slice`.
6
6
* {{link lang isSet Set}} or arbitrary {{link lang isIterator iterator}}: convert to array by iterating.
7
7
8
-
The output is always a shallow copy. Mutation doesn't affect the source.
8
+
Unlike {{link iter values}}, this function rejects other inputs such as non-nil primitives, dicts, maps, arbitrary iterables, ensuring that the input is always a sequence.
9
9
10
-
Unlike {{link iter values}}, `arr` rejects other inputs such as non-nil primitives, dicts, maps, arbitrary iterables, ensuring that the input is always a sequence.
10
+
The input may or may not be a copy. To ensure copying, use {{link iter arrCopy}}.
Similar to [`Array.isArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) and {{link lang isArr}}, but returns true only for instances of the _exact_`Array` class, false for instances of subclasses.
2
+
3
+
At the time of writing, subclasses of `Array` suffer horrible performance penalties in V8, and possibly in other engines. Using them can also cause deoptimization of code that would otherwise run much faster. We sometimes prioritize or even enforce "true" arrays for consistent performance.
Returns a version of the given dict, keeping only the given properties. Keys can be either a `Set` or an arbitrary {{link iter arr sequence}}. Each key must satisfy {{link lang isKey}}. Existence is not required: missing properties are silently ignored. Returns an empty dict if the input is {{link lang isNil nil}}.
3
+
Returns a version of the given dict, keeping only the given properties. Keys can be either a `Set` or an arbitrary {{link iter values sequence}}. Each key must satisfy {{link lang isKey}}. Existence is not required: missing properties are silently ignored. Returns an empty dict if the input is {{link lang isNil nil}}.
0 commit comments