Joined January 2012
·

Slava Ptsarev

Mr at Riabit
·
Saint-Petersburg
·
·
·

Posted to jQuery DOM cache object over 1 year ago

I think this reads better

$C = (function($) {
  var DOMCACHESTORE = {};

  return function(selector, force) {
    if (DOMCACHESTORE[selector] === undefined || force)
      DOMCACHESTORE[selector] = $(selector);
    return DOMCACHESTORE[selector];
  }
})($);
Achievements
227 Karma
17,211 Total ProTip Views