Return to Snippet

Revision: 35220
at November 4, 2010 10:09 by aurorius


Initial Code
Object.prototype.count = function()
{
    c = 0;for(i in this){if (this.hasOwnProperty(i)){c++;}};return c;
}

MyObject = {
    a : '0',
    b : '1',
    c : '2'
}

alert(MyObject.count())

Initial URL

                                

Initial Description

                                

Initial Title
Count Object Keys

Initial Tags
javascript

Initial Language
JavaScript