Copy in the text and click Get Results button. Array code can be copied out from the bottom textarea.
array item 1
array item 2
array item 3
var MyArray = ['array item 1','array item 2','array item 3'];
Array length can be defined by a numeric variable that has zero initialized (e.g. var arrLength = 0;). Creating an array is simple, and it starts with the keyword new. The form of the new quote marks determines what type of data you need to store there in order to add it into your list (e.g., "new Array();" would create an empty array with no items).
- Tools to use for converting text lists into arrays
- How to convert a text list into an array