Why array.splice() method isn't working right? Which array method can help to solve the problem?
function foo(arr,num){   return arr.map((item,index,arr) =&gt; {     return arr.splice(index,num)  ...
Tags: javascript, programming, array, arraymethods