function addRandomFact() {
  const funFacts = [
    `I've built 8 computers so far!`,
    'I interned at Google last summer.',
    'I spent my last summer in New York City.',
    'I speak Spanish.',
    'I love broccoli.',
    `I can solve a Rubik's Cube.`
  ];

  // Pick a random greeting.
  let funFact = funFacts[Math.floor(Math.random() * funFacts.length)];

  // Add it to the page.
  const funFactContainer = document.getElementById('fun-fact-container');
  while (funFactContainer.innerText == funFact) {
    funFact = funFacts[Math.floor(Math.random() * funFacts.length)];
  }
  funFactContainer.innerText = funFact;
  funFactContainer.style.backgroundColor = 'whitesmoke';
}
/**
 * Adds a random fun fact to the page.
 */
Adds a random fun fact to the page.
Adds a random fun fact to the page .
function addRandomFact() {
  const funFacts = [
    `I've built 8 computers so far!`,
    'I interned at Google last summer.',
    'I spent my last summer in New York City.',
    'I speak Spanish.',
    'I love broccoli.',
    `I can solve a Rubik's Cube.`
  ];
  let funFact = funFacts[Math.floor(Math.random() * funFacts.length)];
  const funFactContainer = document.getElementById('fun-fact-container');
  while (funFactContainer.innerText == funFact) {
    funFact = funFacts[Math.floor(Math.random() * funFacts.length)];
  }
  funFactContainer.innerText = funFact;
  funFactContainer.style.backgroundColor = 'whitesmoke';
}
function addRandomFact ( ) { const funFacts = [ ` ` , 'I interned at Google last summer.' , 'I spent my last summer in New York City.' , 'I speak Spanish.' , 'I love broccoli.' , ` ` ] ; let funFact = funFacts [ Math . floor ( Math . random ( ) * funFacts . length ) ] ; const funFactContainer = document . getElementById ( 'fun-fact-container' ) ; while ( funFactContainer . innerText == funFact ) { funFact = funFacts [ Math . floor ( Math . random ( ) * funFacts . length ) ] ; } funFactContainer . innerText = funFact ; funFactContainer . style . backgroundColor = 'whitesmoke' ; }
Adds a random fun fact to the page.
Adds a random fun fact to the page .
// Pick a random greeting. // Add it to the page.