function typeWord() { 
  var displayedText =  PAGE_PHRASES[currrentPhrase].substring(0, letterIndex + 1);
  console.log(displayedText); 
  element.innerText = displayedText;
  letterIndex++;

  // If full sentence has been displayed then start to delete the sentence after some time
  if(displayedText === PAGE_PHRASES[currrentPhrase]) {
    // Hide the cursor
    //cursor.style.display = 'none';

    clearInterval(interval);
    setTimeout(function() {
      interval = setInterval(deleteWord, 50);
    }, 1000);
}
}
/**
 * Function which implements the typing animation.
 */
Function which implements the typing animation.
Function which implements the typing animation .
function typeWord() { 
  var displayedText =  PAGE_PHRASES[currrentPhrase].substring(0, letterIndex + 1);
  console.log(displayedText); 
  element.innerText = displayedText;
  letterIndex++;
  if(displayedText === PAGE_PHRASES[currrentPhrase]) {
    clearInterval(interval);
    setTimeout(function() {
      interval = setInterval(deleteWord, 50);
    }, 1000);
}
}
function typeWord ( ) { var displayedText = PAGE_PHRASES [ currrentPhrase ] . substring ( 0 , letterIndex + 1 ) ; console . log ( displayedText ) ; element . innerText = displayedText ; letterIndex ++ ; if ( displayedText === PAGE_PHRASES [ currrentPhrase ] ) { clearInterval ( interval ) ; setTimeout ( function ( ) { interval = setInterval ( deleteWord , 50 ) ; } , 1000 ) ; } }
Function which implements the typing animation.
Function which implements the typing animation .
// If full sentence has been displayed then start to delete the sentence after some time // Hide the cursor //cursor.style.display = 'none';