Learn the three best ways to get the first line of a multiline string in JavaScript, including using String.indexOf and String.slice, Array.split method, and String.match method with regex.
Sort: