input.split(/[ ,]+/); //splits string using RegEx on a space OR a comma
const splittedStr = (str) => str.split(',')
var array = string.split(',');
let message = 'I am a Happy Go lucky Guy';
console.log(message.split(' ', 4)); // ["I", "am", "a", "Happy"]