Push To End Of Array Javascript Length Function In R