Bash Define Function In Javascript