Test name | Executions per second |
---|---|
Object.hasOwnProperty | 2113662.0 Ops/sec |
Object in | 2768516.8 Ops/sec |
direct | 2918915.5 Ops/sec |
var object = {},
array = [],
i, test = 1000;
for (i = 0; i < 1000; i++) {
object['something' + i] = {};
array.push('something' + i);
}
Object.prototype.hasOwnProperty.call(object, 'something' + test)
('something' + test) in object
!!object['something' + test]