Split Bash String Into Array Js Functions