Convert array range to array view.
function fromArray(x, i, I) // x: an array // i: begin index [0] // I: end index [|x|]
const xarrayView = require('extra-array-view'); // Example for fromArray var x = [10, 40, 30, 20, 50]; var y = xarrayView.fromArray(x, 1, 4); y[0] = 41; y[1] = 31; y[2] = 21; x; // → [ 10, 41, 31, 21, 50 ] y.push(60); // → 5 (NOP, array view is not resizable) x; // → [ 10, 41, 31, 21, 50 ] y.slice(0, 2); // → [ 41, 31 ]
There was an error while loading. Please reload this page.