takeOut
takeOut<
T>(items):T
Defined in: src/global/collections.ts:135
Remove one random element and return it. Mutates the array.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”T[]
Returns
Section titled “Returns”T
Example
Section titled “Example”const deck = ["A", "K", "Q", "J"];takeOut(deck); // "Q", and deck is now [ "A", "K", "J" ]