> For the complete documentation index, see [llms.txt](https://eleven-fifty-academy.gitbook.io/javascript-152-objects-arrays/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eleven-fifty-academy.gitbook.io/javascript-152-objects-arrays/05-arrays/array-methods/.split-method.md).

# .split() Method

Use the `.split()` method when you want to split up a string into chunks. Let's say you wanted to split the sentence **"The quick brown fox jumps over the lazy dog"** into nine separate elements.

```javascript
var str = "The quick brown fox jumps over the lazy dog.";

//splitting by whitespace
var strSplit = str.split(" ");

console.log(strSplit);
```

**Output**

```javascript
[ 'The', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog']
```

Now that you have the array, you can determine the number of words in a sentence. You could use this knowledge to grab a first name from a person's full name. In the next module, we'll use it to split a word into individual characters. Also, notice the empty `" "` in `str.split`? You can split a string using any character you want!
