nit: Use `Array.prototype.slice.call` then we can avoid creating a new array object.