Following this with the `indexOf` call is traversing twice.
Easy micro-optimization `if (index = list.indexOf(a)) > -1 then list.splice(index, 1)`.