how to split data with new line in javascript and save as array code example Example: split array by character javascript s.split("");