/ Published in: JavaScript

if you need ecmascript 5 functions then use underscore.js
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Object.prototype.size = function() { var size = 0, key; for (key in this) { if (this.hasOwnProperty(key)) size++; } return size; };
Comments
