@extra-array/infix
v2.10.19
Published
Picks an arbitrary infix.
Downloads
326
Readme
Picks an arbitrary infix. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:
Similar: infix, infixes, hasInfix, searchInfix.
This is part of package extra-array.
array.infix(x, [n], [r]);
// x: an array
// n: number of values (-1 => any)
// r: random seed 0->1
const array = require("extra-array");
var x = [1, 2, 3];
array.infix(x);
// [ 1, 2 ]
array.infix(x, 1);
// [ 2 ]
array.infix(x, 1, 0.5);
// [ 2 ]