Now of course, code only does what you make it do.
But i'm confused why in the following code:
var a = {
0: "Hi",
1: "Bye"
}
for (var b in a) {
setTimeout(function () {
console.log(b);
}, 1000);
}
Instead of consoling "0" and then "1"
I just get "1" twice.
I'm not sure why that happens. I need a setup like that for a script I am making but I also get the same issue.