题解 | #查找元素位置#
查找元素位置
http://www.nowcoder.com/practice/0a9af9cb20c34babb6232126e019c74d
function findAllOccurrences(arr, target) {
let res = []
let i = 0
for(let v of arr) {
if (v == target) {
res.push(i)
}
i++
}
return res
}
三奇智元机器人科技有限公司公司福利 56人发布