Idea:
//In the array arr, find all the positions where the element with the same value as item appears.
// Idea: loop, and then judge if item and an item in the array ===, then put it into another array .
//Then output
function findAllOccurrences(arr, target) {
var arr1=[];
for(var i=0;i<arr.length;i++)
{
if(target===arr[i])
{
arr1.push(i);
}
}
return arr1;
}