pickArrayItemconstant
pickArrayItem: <T>(items: PossibleArray<T>, pick: T) => ImmutableArray<T>
| Return | |
|---|---|
unknown | A new array containing only the picked item, or the same array if nothing changed. |
Pick an item from an array (immutably) and return a new array with that item (or the same array if no changes were made).
Examples
pickArrayItem([1, 2, 3], 2); // [2]