same.js
Version:
A Class of Parallel Arrays Manipulation
13 lines (11 loc) • 604 B
JavaScript
const {Same} = require("Same");
var same = new Same();
async function main() {
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
}
await same.forEach((element) => { // starts to loop throught every element in the same
console.log(element) // every time the loop executes it outputs the element
})
}
main() // calls and async function (THE MODULE forEach() MUST BE AWAITED)