I need to split a keyword string and turn it into a comma delimited string. However, I need to get rid of extra spaces and any commas that the user has already input.
In ES6:
var temp = str.split(",").map((item)=>item.trim());