Array decomposing recursive function in JavaScript
If you don't need using recursion, this is an alternative where you can get rid of the second param of the function.



const stringToArray = (str) =&gt; {
  const result = [];
  let wordArray = str.split(' ');
  
  while(wordArray.length &gt; 0) {
    result.push(wordArray.join(' '));
    wordArray = wordArray.slice(1);
  }
  
  return result;
};

const partsArray = stringToArray('Chicago IL 12345 United States');

console.log(partsArray);