Discuss / JavaScript / 注释的部分 显得我逻辑还有些混乱

注释的部分 显得我逻辑还有些混乱

Topic source

return arr.filter(function(x){ if(x===1){return false;} //if(x===2){return true;} for(let i=2;i<x;i++){ if(x%i===0){ return false;

        }
    }
    return true;

});

  • 1

Reply