Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function Properties #43

Open
dvas0004 opened this issue Jun 18, 2019 · 0 comments
Open

Function Properties #43

dvas0004 opened this issue Jun 18, 2019 · 0 comments
Assignees
Labels

Comments

@dvas0004
Copy link
Owner

@dvas0004 dvas0004 commented Jun 18, 2019

Function Properties are a good alternative to globally scoped variables. For example:

const greet = () => {
    ...
   console.log(1 + greet.var1) // outputs 124
    ...
}
greet.var1 = 123; // actual function property

All instances of the "greet" function have access to the same value of greet.var1

function variables = "static variables"

@dvas0004 dvas0004 added the JavaScript label Jun 18, 2019
@dvas0004 dvas0004 self-assigned this Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.