Why does the following code runs:
someExpression.then((result)=>{
console.log(util.inspect(result,{depth:null}));
return result;
}))
and when this function has a name it doesn't:
function print(result) {
console.log(util.inspect(result,{depth:null}));
return result;
}
someExpression.then(print(result)))
with error:
ReferenceError: result is not defined