I have created a textarea for users to enter numbers separated by a new line. I am using this code to assign all of the numbers into an array
var arrayOfLines = document.getElementById('myTextArea').value.split('\n');
However when I try to do an alert
alert("First element: " + arrayOfLines[0]);
My output ignores the array and only looks like:
First element:
So I need to know how to output the first element of the array through alert.