Array.indexOf('whatever') fails in simulator, not in webview

Hi there,

So I have this very, very simple code in a function somewhere:

var index = array.indexOf("value");
if (index > -1){
} else {

In Chrome, it works perfectly. However, in ionic view or once I compile it (I only tested iOS), on simulator and on an actual device, the code doesn’t log and do anything at all. If I set index manually, it works as expected.

What am I missing here?

and the “array” is set in every case or at least initialized as an empty array?

It should be. During the night I thought of a possibility that indexOf goes off before it is initialized… will look into that. :thumbsup: