Skip to content

24 ways to impress your friends

Vote up?

Rob L.

Useful tips all. One mini-pattern that I’ve picked up from co-workers is, when caching selectors, prefix your variable with $ to note that it’s a jQuery object. This can be really helpful in methods where you’re dealing with lots of variables, especially when you come back later to modify them or fix bugs.

var $blocks = $(”#blocks”).find(“li”);