Manipulating arrays using push, pop, shift, unshift, and splice