Is there a way to split a multiline string into lines without considering the newline characters within the lines?
I tried this method but it didn't work as expected:
const str = `
Hello
World\t
its\nbeautiful
`;
JSON.stringify(str).split(/$\\n/g)
What is the resulting array from this approach:
[""", "Hello", "World\t", "its", "beautiful", """]
What should be the desired result instead:
[""", "Hello", "World\t", "its\nbeautiful"]