@extra-array/suffixes
v2.10.19
Published
Lists all possible suffixes.
Downloads
382
Readme
Lists all possible suffixes. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:
This is part of package extra-array.
array.suffixes(x, [n]);
// x: an array
// n: number of values (-1 => any)
const array = require("extra-array");
[...array.suffixes([1, 2])];
// [ [ 1, 2 ], [ 2 ], [] ]
[...array.suffixes([1, 2, 3])];
// [ [ 1, 2, 3 ], [ 2, 3 ], [ 3 ], [] ]