obj key existence speed

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
first
const test = {test: 123};

Boolean(test.test)
ready
second
const test = {test: 123};

Boolean(test.hasOwnProperty('test'))
ready
third
const test = {test: 123};

Boolean(Object.prototype.hasOwnProperty.call(test, 'test'))
ready
fourth
const test = {test: 123};

Boolean(Object.hasOwn(test, 'test'))
ready
fifth
const test = {test: 123};

Boolean(Object.keys(test).includes('test'))
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.