Discuss / JavaScript / 作业

作业

Topic source

Niko

#1 Created at ... [Delete] [Delete and Lock User]

    return arr.filter(function(el){

if(el===1)

   return false;

for(let i=2; i<el; i++)

   if(el%i===0)

return false;

return true;

});


  • 1

Reply