Ruby Remove Value From Array Javascript Push To Beginning