While technically the for loop may be a little faster to execute, the for in or for of loops are much cleaner to write.
I would suggest using for in and for of when they are appropriate.
As for your question about for in not working, it should work if you’re using it correctly. I don’t see an example of for in above tho, only for of. Is that what you meant?