Bash Read String Into Array Javascript Iteration