I have tried string split(), regex in Javascript to try and target each line of a multi line string in a back quote into an array

Viewed 17

const data =

` Scot

56

United State

100 `

I want it to return each line in an array I.e ["Scot",56,"United States",100] and not ["Scot",56,"United","States",100] I don't just seem to find away around it

0 Answers
Related