Hello everyone, I am currently learning and trying to figure out how to convert a string into an array.
var myString = 'one,two\nthree,four\nfive\nsix,seven'
What I aim to achieve is converting the string into an array of arrays as follows:
var newArray = [['one','two'],['three','four'],['five'],['six','seven']]
Essentially, I want to handle the line breaks in myString by converting them into arrays, while also splitting the words and assigning them as individual elements within each array.
I would really appreciate any guidance or assistance on this matter. Thank you!