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
Hi everyone. I only do JS for a couple of weeks now and could not find out, why the code
this.show = function(username, cb) { var command = username ? "/users/"+username : "/user"; _request("GET", command, null, function(err, res) { cb(err, res); }); };
Works with
....show('dctr', myFunc);
and with
....show(myFunc);
Why doesn't command evaluate to something absurd and cb fails but myFunc is called in both cases? At least i would have expected something like
cb = username ? cb : username;
Thanks in advance for anwers...
The text was updated successfully, but these errors were encountered:
Actually this is a good question. This is not supposed to work when called with one param.
Something like this should do it:
this.show = function(username, cb) { var path = cb ? "/users/"+username : "/user"; cb = cb ? cb : username; _request("GET", path, null, function(err, res) { cb(err, res); }); };
Sorry, something went wrong.
Strange thing, but as mentioned above, both work...
Merge pull request github-tools#51 from sbergmann/master
ee8cf8d
Fix _.extend returning an array instead of an object
No branches or pull requests
Hi everyone. I only do JS for a couple of weeks now and could not find out, why the code
Works with
and with
Why doesn't command evaluate to something absurd and cb fails but myFunc is called in both cases? At least i would have expected something like
Thanks in advance for anwers...
The text was updated successfully, but these errors were encountered: