diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index f7f8340a7..b490c45f0 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -35,9 +35,7 @@ exports.trim = function(str) { Return the number of keys in an object */ exports.count = function(object) { - var s = 0; - $tw.utils.each(object,function() {s++;}); - return s; + return Object.keys(object || {}).length; }; /* @@ -645,4 +643,4 @@ exports.tagToCssSelector = function(tagName) { }; -})(); \ No newline at end of file +})();