Message from JavaScript discussions

November 2018


const foo = () => bar; // definition time
foo(); // call time


It's not definition, it already works, creates a variable. difinitions are only possible in compiled languages

— There's no technical difference, but there is a difference for the user

— So you're saying every call to an arrow function binds it?

— Not every, but first call. as you saw in that benchmark.. you said it was weird. no it's not weird

— But it's not in first call

— It's a lexical scoping

— If I bind foo, the return value changes

— So how can it be bound?

— Make a test first, you didnt run it, right

— I did

— Then drop code here