I've seen a bunch of answers on JS about an infinite loop and I thought that it would help for my code but it doesn't seem to be working properly. I have that:
var i = 0
while (true) {
setTimeout(() => {
i ++
console.log('Infinite Loop Test n:', i);
}, 2000)
}
The objective is to get the log every 2 seconds within an infinite loop but I can't seem to be getting anything back... Where am I mistaken?
Thanks in advance for your help as usual!