const getLongestWords = text => {
  let words = text.split(' ');
  let longest = 0;
  return words.reduce((acc, curr) => {
    if (curr.length >= longest) {
      longest = curr.length;
      acc.push(curr);
    }
    return acc;
  }, []);
}

let text = "Everyone should learn how to program a computer because it teaches you how to think";
console.log(getLongestWords(text));