The number to extract digits.
The radix of digit.
The list of digits of the number.
expect(toArray(digits(51413, 10))).toStrictEqual([3, 1, 4, 1, 5]);
expect(toArray(digits(0x51413, 16))).toStrictEqual([3, 1, 4, 1, 5]);
expect(toArray(digits(0o51413, 8))).toStrictEqual([3, 1, 4, 1, 5]);
expect(toArray(digits(0b1001011001, 2))).toStrictEqual([
1,
0,
0,
1,
1,
0,
1,
0,
0,
1,
]);
expect(toArray(digits(0, 10))).toStrictEqual([]);
Extracts digits of the number.