Code not working atm

Any reason why if (counter === 4) { window.clearInterval(window.interval)} works and
if (counter === array.length) { window.clearInterval(window.interval)} doesn’t work?

These are both number types… I don’t get it.

=== checks for data type also. Are they both exactly the same data type?

Yes, i wrote it in the first post. Checked typeof, tried == ; doesn’t work

can you post the rest of the code?

Sorry, too long . The app has many modules. Solved it though… the array was reseted at some point in another module. And my test didn’t catch it.