-
Notifications
You must be signed in to change notification settings - Fork 5
isuffixes
Subhajit Sahu edited this page May 3, 2023
·
1 revision
List all possible suffixes.
Alternatives: isuffixes, suffixes.
Similar: randomSuffix, suffixes, hasSuffix.
function isuffixes(x, n)
// x: an array
// n: number of values [-1 ⇒ any]
const xarray = require('extra-array');
[...xarray.isuffixes([1, 2])];
// → [ [ 1, 2 ], [ 2 ], [] ]
[...xarray.isuffixes([1, 2, 3])];
// → [ [ 1, 2, 3 ], [ 2, 3 ], [ 3 ], [] ]