logoalt Hacker News

Rohansi • today at 1:22 PM • 1 reply • view on HN

The function reference is actually evaluated first so your preferred order is actually backwards! Consider this:

  foo.bar(x)
The `foo.bar` field has to be retrieved before the function can be called. It does not evaluate `x` first. That is observable with JS proxies, or you can test with code like this:

  foo()(bar())

Replies

LtWorf • today at 2:06 PM

Executing the "." operator isn't the same as executing the function.

➕ show 1 reply