题解 | #查找重复元素#
查找元素位置
http://www.nowcoder.com/practice/0a9af9cb20c34babb6232126e019c74d
function findAllOccurrences(arr, target) {
let newArr = []
for (let i in arr) {
if (arr[i] === target) {
newArr.push(i)
}
}
return newArr
}