We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
$('#something') &click !-> blah(&attr("foo")) $('#somethingelse') &click !-> blah(&attr("bar"))
compiles to
var x$; x$ = $('#something'); x$.click(function(){ blah(x$.attr("foo")); }); x$ = $('#somethingelse'); x$.click(function(){ blah(x$.attr("bar")); });
which causes problems with the first click handler's x$ referring to the second one due to lexical scope.
x$
I know this could be easily circumvented with let but I still think this is counter-intuitive behavior.
let
Feel free to close if I'm wrong :)
The text was updated successfully, but these errors were encountered:
You're right. Apparently it shouldn't reuse the same variable.
Sorry, something went wrong.
3a85ac1
No branches or pull requests
compiles to
which causes problems with the first click handler's
x$
referring to the second one due to lexical scope.I know this could be easily circumvented with
let
but I still think this is counter-intuitive behavior.Feel free to close if I'm wrong :)
The text was updated successfully, but these errors were encountered: