[javascript] How to split a comma separated string and process in a loop using JavaScript