I'm making a Pearson's coefficient calculator so I need to get a data from input in format divided by commas "1,2,3,4,5" or by spaces "1 2 3 4 5" and anyways this is going to be a string and I need to turn it into array such as [1, 2, 3, 4, 5] so i can perform all the Math.
And this is where I struggle, I tried using for loops and slice() and parseInt() methods but it's so clunky and didn't work out anyways.
Thank you in advance