Função de içamento em js

function mymethod(){
  alert("global mymethod");
}

function mysecondmethod(){
  alert("global mysecondmethod");
}

function hoisting(){
  alert(typeof mymethod);
  alert(typeof mysecondmethod);

  mymethod();         // local mymethod
  mysecondmethod(); // TypeError: undefined is not a function

  // mymethod AND the implementation get hoisted
  function mymethod(){
    alert("local mymethod");  
}

// Only the variable mysecondmethod get's hoisted
var mysecondmethod = function() {
    alert("local mysecondmethod");  
};
}
hoisting();

Eu não sou capaz de entender como o içamento funciona neste caso e por quealert("local mysecondmethod"); não é mostrado. Se alguém puder me mostrar a sequência, seria útil

questionAnswers(2)

yourAnswerToTheQuestion