Boilerplate reduction

I find myself writing some common boilerplate patterns in my code, and have recently started using Dojo’s partial() and getObject() functions to reduce some of these:

Extract deep properties from an array of objects
Boilerplate, function(i) { return i && && &&; ));

Trick, dojo.partial(dojo.getObject, "", false));

Additionally, I stumbled across this little nugget:

Filter out “empty” elements from an array

dojo.filter(array, function(i) { return !!i; ));


dojo.filter(array, Boolean);