repl.it
@Tyledelphia/

getAllWords-2

JavaScript

No description

fork
loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function getAllWords(str) {
  let wordArray = [];
  let wordCount = 0
  let words = str.split(' ')
  for (let i = 0; i < str.split(' ').length; i++) {
    if (str[i] === ' ') {
    }
    let splits = words[i];
    wordArray.push(splits)
    }
    return wordArray;
  }
  getAllWords('The quick brown fox jumps over the lazy dog');
Native Browser JavaScript