-
Notifications
You must be signed in to change notification settings - Fork 5
cycle
wolfram77 edited this page Apr 13, 2020
·
20 revisions
Gives values that cycle through an array. [:running:] [:vhs:] [:package:] [:moon:]
array.cycle(x, n);
// x: an array
// n: number of values
const array = require('extra-array');
var x = [1, 2, 3];
array.cycle(x, 2);
// [1, 2]
array.cycle(x, 4);
// [1, 2, 3, 1]
array.cycle(x, 6);
// [1, 2, 3, 1, 2, 3]