hasOwnProperty VS !== undefined

Benchmark created on


Setup

const myObj = {
	test: 0
}
const testKey = "test"

Test runner

Ready to run.

Testing in
TestOps/sec
hasOwnProperty
return myObj.hasOwnProperty[testKey]
ready
!== undefined
return myObj[testKey] !== undefined
ready

Revisions

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