Shell Script Loop Through Array Javascript Function Declaration