Bash Script Loop Through Array Javascript Iteration