Js Remove Element From Array Based On Condition