I have this array:
var array = [400, 4000, 400, 400, 4000];
How can I get the index of the first element with value greater than 400?
var array = [0, 0, 3, 5, 6]; var x = 5; var i = 0; while (array[i] <= x) { i++; }