The console.log just write a text and return with undefined.
If you create a function, add a returning value, there will be not undefined, it will returns with the added value.
Example:
function writer(){
console.log("write new line");
return "ok";
}
If you call the writer() that the output is "ok" in new line after "write new line".