I’m doing the Seek and destroy algorithm challenge but I don’t know what I’m doing I’ve tried doing several different versions of the same code but I can’t seem to get it.
<p> function destroyer(arr) {
var args = Array.prototype.slice.call(arguments[0], arguments[1]);
return args;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3); </p> And this
<p> function destroyer(arr) {
var args = Array.prototype.slice.call(arguments[0], arguments[1],arguments[2]);
// using 3 arguments in the later call ^^
return args;
}
// to store (or directly use) the returned value:
var result = destroyer([1, 2, 3, 1, 2, 3], 2, 3);
alert(result); </p>