mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-03 10:40:15 +08:00
build
This commit is contained in:
@@ -1090,7 +1090,7 @@ elementAddr = firtstElementAddr + elementLength * elementIndex
|
||||
/* 在数组中查找指定元素 */
|
||||
function find(nums, target) {
|
||||
for (let i = 0; i < nums.length; i++) {
|
||||
if (nums[i] == target) return i;
|
||||
if (nums[i] === target) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user