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

Add slide on bracket notation function dispatch #11

Open
Will-Sommers opened this issue Apr 16, 2015 · 2 comments
Open

Add slide on bracket notation function dispatch #11

Will-Sommers opened this issue Apr 16, 2015 · 2 comments
Labels

Comments

@Will-Sommers
Copy link
Contributor

No description provided.

@afeld
Copy link
Member

afeld commented Apr 16, 2015

Can you give an example?

@Will-Sommers
Copy link
Contributor Author

loggingClient = {
  loggingFnOne: function (args){....},
  loggingFnTwo: function (args){....}
}

var doSomeWork = function(args) {
  logFn = args.predicate ? "loggingFnOne" : "LoggingFnTwo";
  loggingClient[logFn](args);
}

Sort of contrived example but it is a pretty O_o moment for some folks.

@afeld afeld added the content label Apr 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants