Closed bencodezen closed 2 weeks ago
Name | Link |
---|---|
Latest commit | 2aaff24b6c4dd29d0373275617abf6e3fdb6a793 |
Latest deploy log | https://app.netlify.com/sites/vuejs/deploys/66293f4a0a1ad2000875b892 |
Deploy Preview | https://deploy-preview-2817--vuejs.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
I don't think getter function in Vue's context is same as get
syntax. It's more like any function that returns something.
That MDN link just shows things like const foo = { get bar() { return 1 } }
. If one is reading that link and will try to apply that to, say, computed
it won't work.
I don't think getter function in Vue's context is same as
get
syntax.
Then perhaps a better approach would be to include it into Glossary under its own label? š¤
Any idea why the term "getter function" is used so consistently?
Maybe use "value-returning-function" or "function that returns a value" instead to make it more clear that it's not a special concept?
I don't think getter function in Vue's context is same as
get
syntax. It's more like any function that returns something.That MDN link just shows things like
const foo = { get bar() { return 1 } }
. If one is reading that link and will try to apply that to, say,computed
it won't work.
Further down in the description, there's the following snippet:
The getter syntax allows you to specify the getter function in an object initializer.
I believe this is the concept that we are referring to, though maybe I'm wrong.
W00t!
Description of Problem
Getter functions are referenced a lot in docs, but if you're new to JS, it is unclear whether this is a Vue thing or a JS thing.
Proposed Solution
Similar to how acronyms are defined at the beginning of each article before being used throughout the rest, adding a link referencing to what getters / setters are can help provide clarity to people newer to JavaScript and haven't encountered these concepts yet.
Additional Information
Related issue #2528