📜  javascript代码示例中的过滤

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

代码示例6
//filter numbers divisible by 2 or any other digit using modulo operator; %
  
  const figures = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
  const divisibleByTwo = figures.filter((num) => {
    return num % 2 === 0;
  });
  console.log(divisibleByTwo);