Ruby Remove Element From Array Javascript Methods For Objects