I've watched some videos and they said "functions always return a value". If we don't use the return statement, then what does it return instead? Like the function below:
function Foo(){
var x = 4.
y =5;
z = x + y;
}
x = Foo();
console.log(x);
The function should return an 'undefined' property when it is called with x
There is generally two scenario:
// 1
console.log(x)
// 2
console.log(x())
In scenario 1 (which is depicted in your example), it will return a reference of the function (which can be used to execute later). In scenario 2, it will executes the function and return an undefined property. Do check out this website if to know more