Jquery Loop Over Array Javascript Push Pop