📅  最后修改于: 2022-03-11 15:02:43.528000             🧑  作者: Mango
const linearSearch = (list, item) => {
for (let i = 0; i < list.length; i++) {
console.log(`we are at ${i} and item ${list[i]}`);
if (item === list[i]) return i;
}
};
console.log(linearSearch([2, 6, 7, 90, 103, 11, 24], 90));