Key count for object - Node.js Object

Node.js examples for Object:Object Operation

Description

Key count for object

Demo Code

Util.KeyCount = function(obj) {
  var c = 0;//from   w  w  w  . j  av a2  s.c o m
  for(var j in obj) {
    obj.hasOwnProperty(j) && ++c;
  }
  return c;
}

Related Tutorials