Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

callback pattern modification #42

Merged
merged 1 commit into from

2 participants

@Grom-S

i think there is no reason to check it twice

@shichuan
Owner

thanks for the request, but i will change the == to ===

@shichuan shichuan merged commit 805176f into shichuan:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 11, 2012
  1. @Grom-S

    callback pattern modification

    Grom-S authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 6 deletions.
  1. +2 −6 function-patterns/callback.html
View
8 function-patterns/callback.html
@@ -16,14 +16,10 @@
var findNodes = function (callback) {
var nodes = [];
- // check if callback is callable
- if (typeof callback !== "function") {
- callback = false;
- }
-
var node = complexComputation();
- if (callback) {
+ // call if callback is callable
+ if (typeof callback == "function") {
callback(node);
}
Something went wrong with that request. Please try again.