Bash Loop Through Array Javascript Push Apply