printNumTwo = function() { return i; }; -- is it a way of defining function?

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**


var printNumTwo;
for (var i = 0; i < 3; i++) {
if (i === 2) {
  printNumTwo = function() {
    return i;
  };
}
}
console.log(printNumTwo());

What is following line ?
printNumTwo = function() {
return i;
};

Yes, that is defining a function.