Joined January 2012
·

Slava Ptsarev

Mr at Riabit
Mr
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
11,729 Total ProTip Views