C Sharp Loop Through Array Javascript Push Pop