📜  在 Javascript 代码示例中过滤数组

📅  最后修改于: 2022-03-11 15:01:12.529000             🧑  作者: Mango

代码示例5
function bouncer(arr) {
  let newArray = [];
  for (let i = 0; i < arr.length; i++) {
    if (arr[i]) newArray.push(arr[i]);
  }
  return newArray;
}