Closed hassanbazzi closed 9 years ago
if indexOf returns -1, and we're trying to remove an item that doesn't exist, then the current code will delete the last item in the array anyways.
amirite?
Good catch, but do this:
if (~item) this.items.splice(item, 1);
if indexOf returns -1, and we're trying to remove an item that doesn't exist, then the current code will delete the last item in the array anyways.
amirite?