Intermediate Algorithm Scripting: Drop it. Why is this code not working?

function dropElements(arr, func) {

while (func(arr[0])===false){

var filteredarray= arr.slice();

break;

}

console.log(filteredarray);

return filteredarray

}

dropElements([0, 1, 0, 1], function(n) {return n === 1;});

I don´t understand why this isn´t working. Could someone explain?

Nevermind, solved it! I was actually using slice wrong.