第 161 题:用最精炼的代码实现数组非零非负最小值index

Author: libin1991Created Sep 15, 2020Updated Jun 25, 2026

例如:[10,21,0,-7,35,7,9,23,18] 输出5, 7最小

function getIndex(arr){
      let index=null;
      ...
      return index;
}

Source: Advanced-Frontend/Daily-Interview-Question