Joined October 2012
·

Jorge Luis Rivera

Loreto, Zacatecas, México
·
·
·

@datreee Cool buddy, any issues please ping me.

Nice tip. Seems like the Underscore.js implementation -->
http://documentcloud.github.com/underscore/#isEmpty

Just that those guys are checking for Arrays and String in the same function like this:

_.isEmpty = function(obj) {
   if (obj == null) return true;
   if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
   for (var key in obj) if (_.has(obj, key)) return false;
   return true;
 };
Achievements
130 Karma
7,225 Total ProTip Views