i was reading through mdn documentation on promises and got my attention this part
Note: Several other languages have mechanisms for lazy evaluation and deferring a computation, which they also call "promises", e.g. Scheme. Promises in JavaScript represent processes that are already happening, which can be chained with callback functions. If you are looking to lazily evaluate an expression, consider the arrow function with no arguments: f = () => expression to create the lazily-evaluated expression, and f() to evaluate.
why particularly arrow function is used when it comes it lazy evaluation, it doesn't provide extra feature such caching maybe. so am i missing something?
for example both of them are working in same way for lazy evaluation
let a = (x) => 2*3;
let b = function(){
return 2 * 3;
}
if(someCondition){
console.log(a());
}
if(otherCondition){
console.log(b());
}