Javascript developer interview question

Had an interesting question come up in my interview for a MEAN stack developer today. Basically wanted to know what the resulting output of –

(function () {
   for (i = 0; i < 3; i++) {
      setTimeout(function () {
         console.log(i)
      }, i * 1000)
   }
})();

would be. Any guesses?