📅  最后修改于: 2022-03-11 15:01:19.793000             🧑  作者: Mango
const arr = [0,1,4,3,4];
const max = Math.max(...arr);
let res = [];
arr.forEach((item, index) => item === max ? res.push(index): null);
console.log(res);