I'm trying to write a function that returns the index of an object where the value is less than 100. It currently returns -1 indicating that none of the objects meet that criteria when in fact I know that one does. I imagine it's something simple that I am just spacing out on. Can anyone offer a suggestion? Thanks
var distance = [ 16996.054413094975,
102.48330298955042,
8930.89370465407,
10856.832465874579,
6820.160641562082,
114.07012348350867,
8730.587245583654,
325.9682182750614,
6247.132833741246,
6528.189432909801,
10856.170817339278,
8036.961700844721,
98.66650647724741,
16265.209545673928,
16266.769167269893,
715.0404901364141,
7121.899289338758 ];
var addresses = function(){
for (var i = 0; i <= distance.length; i ++)
var indexDistance = distance.indexOf((i) <= 100);
console.log(indexDistance);
};
addresses();