Fix array bad behavior in iOS

This behavior brokes array normal behavior. Using Array.prototype.indexOf fix the issue