This may be a naive but i am not able to understand how javascript assign values to its variables. In this book, i came across the following code.
function greaterThan(n) {
return m => m > n;
}
let greaterThan10 = greaterThan(10);
console.log(greaterThan10(12));
How is m assigned the value 12 ? This does'nt give compile time as well as runtime error. Only if i remove m =>, i get an error that m is not defined.