same.js
Version:
A Class of Parallel Arrays Manipulation
10 lines (7 loc) • 408 B
JavaScript
const {Same} = require("Same");
var same = new Same();
same.insert(1, "one");
same.insert(2, "two");
same.replace(1, false, "one", 1); // replaces the indexes in the Same of the value 1 with "one" in the first array and 1 in the second
same.replace(1, true, "two", 2); // replaces the indexes 1 in the Same with "two" in the first array and 2 in the second
console.log(same);