Test name | Executions per second |
---|---|
undefined | 3252326.5 Ops/sec |
typeof | 9773020.0 Ops/sec |
in | 8927788.0 Ops/sec |
hasOwnProperty | 4524568.0 Ops/sec |
bool | 9799933.0 Ops/sec |
var hasOwnProperty = Object.prototype.hasOwnProperty;
var obj = { a: 1, b: 2, c: 3, d: 4, e: 5 };
undefined !== obj.d;
'undefined' !== typeof obj.d;
'd' in obj;
hasOwnProperty.call( obj, 'd' );
!! obj.d;