Node Js what is the different between the coding

I have one question regarding Node js

Method 1:

app.post('/password-reset', resetPassword)

function resetPassword() {
// code here
}

vs

Method 2:

app.post('/password-reset',  function(req, res){
// code here
});

I understand that both are doing the same thing but why do we need method 1?

Is that any scenario that I must use method 1?