String.prototype.splitbeginner'a,b,c'.split(',') // β ['a', 'b', 'c']
'hello'.split('') // β ['h', 'e', 'l', 'l', 'o']
'hi'.split() // β ['hi']Use split() to divide a string into an array of substrings at each occurrence of the separator.
str.split(separator) splits the string into an array of substrings at each separator.
Challenge: Implement splitByComma(str) that splits a comma-separated string.
splitByComma('a,b,c') // β ['a', 'b', 'c']