Safest way when using for .. in to loop through an array or object in Javascript

There are so many ways to loop through an array or object in Javascript, one of them is using for .. in. For example:

It looks correct, right? But…