Why console.log() returns undefined?
console.log() is a function. A function must always return some value to the caller. It's a ground rule.
If a return value is not specified, then the function will return undefined*.*
For example, see the below code.
function addOneTo(a) {
const ...
sudipta26.hashnode.dev1 min read