Emperor01 / JSlearn

all my practical trainings
0 stars 0 forks source link

wtf #8

Closed Emperor01 closed 6 years ago

Emperor01 commented 6 years ago

'use strict';

var collection = ["test", 2, 1.5, false];

function findarrvalue (arr, value) {

for (var i = 0; i <= arr.length - 1; i++) {

if (arr[i] == value) {return i};

}

return -1;

}

findarrvalue(collection, false);