a191d6e153d6aebbc9b08caf4673e7cc40efecbc
[platform/framework/web/crosswalk-tizen.git] /
1 'use strict';
2
3 var toPosInt = require('../../number/to-pos-integer')
4   , value    = require('../../object/valid-value')
5
6   , hasOwnProperty = Object.prototype.hasOwnProperty;
7
8 module.exports = function () {
9         var i, l;
10         if (!(l = toPosInt(value(this).length))) return null;
11         i = l - 1;
12         while (!hasOwnProperty.call(this, i)) {
13                 if (--i === -1) return null;
14         }
15         return i;
16 };