Created
December 10, 2019 05:41
-
-
Save mcgingras/7c41c4e02f43ea911890f874564664d1 to your computer and use it in GitHub Desktop.
confusing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Test { | |
constructor(arr){ | |
console.log(arr); | |
this.arr = arr; | |
} | |
addHello(i){ | |
this.arr[i] = 'hello'; | |
} | |
} | |
const program = [1,2,3,4,5]; | |
const loopCommands = (program) => { | |
let arrList = []; | |
for(let i = 0; i<5; i++){ | |
arrList[i] = new Test(program); | |
arrList[i].addHello(i); | |
} | |
return arrList; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment