Skip to content

suffixes

Subhajit Sahu edited this page Mar 14, 2020 · 22 revisions

Lists all possible suffixes.

array.suffixes(x);
// x: an array
// --> ...suffixes
const array = require('extra-array');

[...array.permutations([1, 2])];
// [ [ 1, 2 ], [ 2, 1 ] ]

[...array.permutations([1, 2, 3])];
// [
//   [ 1, 2, 3 ],
//   [ 2, 1, 3 ],
//   [ 1, 3, 2 ],
//   [ 3, 1, 2 ],
//   [ 2, 3, 1 ],
//   [ 3, 2, 1 ]
// ]

references

Clone this wiki locally