same.js
Version:
A Class of Parallel Arrays Manipulation
10 lines (8 loc) • 437 B
JavaScript
const { Same } = require("Same");
var same = new Same();
for (let i = 0; i < 10; i++) {
same.insert(i, i - i * 2); // inserts in the first array every number from 0 to 9 and in the second array every number from 0 to -9
}
console.log(same);
console.log("\n\n\n");
console.log(same.cut(2, 4)); // outputs the object with two arrays with every element of the first and second array inside the indexes 2 and 4