ドキュメント

Talk:Types

From jQuery JavaScript Library

Jump to: navigation, search

Suggestion: Use !!

Very well written page. One minor suggestion, despite the note at the top, it's confusing to read

An empty string defaults to false: !"" // true

How about:

An empty string defaults to false: !!"" // false

--Will 06:45, 7 September 2007 (PDT)

I don't have any objections for that Will. Feel free to edit.

-- Jörn

Is the code sample for Proxy Pattern correct?

Shouldn't the code sample for Proxy Pattern look like this:

(function() {
  // log all calls to setArray
  var proxied = jQuery.fn.setArray;
  jQuery.fn.setArray = function() {
    console.log(this, arguments);
    return proxied.apply(this, arguments);
  };
})();

...with the extra parentheses at the end, because otherwise you're defining an anonymous function but never calling it?