The first function will by default return the value of console.log(a) which happens to be undefined in this case. Had it been some function that returns some value, you would have seen fn1 return its value. In the second function, it simply executes the code inside { } and would not return anything until you explicitly use the return keyword.