fix(forEach): differentiate objects with a length property and array like objects
fixes #1840
when an object has a numeric length property:
if an object has a length property with a number value of 0, it will
be considered like an array like object
if the value is positive and the object looks like a full dense array
with a property named as length minus one, it will be considered
like an array like object

Signed-off-by: Gonzalo Ruiz de Villa <gonzaloruizdevilla@gmail.com>