Simply because of [Automatic Semicolon Insertion (ASI)]. Because of ASI, for example if we put the return value (the thing to return) on the next line of the return
keyword, nothing is actually returned. Example:
function provideGreetingSameLine() {
return 'hello';
}
// Prints "hello".
console.log(provideGreetingSameLine());