Skip to content
Discussion options

You must be logged in to vote

good question, but no.

if you image it like

const result = EXPRESSION

then the two you mention would be liek

const result = $store.mystore.storedata

const result = $store.mystore.storedata()

the first is simply evaluating to a function.

The second is calling the function and resolving to whatever that function returns.

In the second, storedata() is invoked as a method on mystore.

In the first, storedata is isolated separately from the object, and then called with the $data as the lexically bound this.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@docdunning
Comment options

@ekwoka
Comment options

Answer selected by docdunning
@docdunning
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants