<!DOCTYPE html>
<html lang="en-US">
<body>
<p>Find the index of first odd number<p>
<script>
var myNumber = [1, 2, 3, 4, 5, 6, 7];
function odd(num, index, arr) {
return (num % this) != 0;
}
document.write(myNumber.findIndex(odd, 2));
</script> </body>
</html>