portfolio/src/main/webapp/script.js
/**
 * Adds a random greeting to the page.
 */
Adds a random greeting to the page.
Adds a random greeting to the page .
function addRandomFact() {
  const greetings =
      ['I have never broken a bone', 'I don\'t like chocolate', 'I can speak Chinese', 'I like pineapple on pizza'];
  const greeting = greetings[Math.floor(Math.random() * greetings.length)];
  const greetingContainer = document.getElementById('greeting-container');
  greetingContainer.innerText = greeting;
}
function addRandomFact ( ) { const greetings = [ 'I have never broken a bone' , 'I don\'t like chocolate' , 'I can speak Chinese' , 'I like pineapple on pizza' ] ; const greeting = greetings [ Math . floor ( Math . random ( ) * greetings . length ) ] ; const greetingContainer = document . getElementById ( 'greeting-container' ) ; greetingContainer . innerText = greeting ; }
Adds a random greeting to the page.
Adds a random greeting to the page .
// Pick a random greeting. // Add it to the page.