in-hasWon-hasOwnProperty

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
in
function checkError() {
	const foo = JSON.parse("{\"error\":null}")
	if ('error' in foo) {
		return true
	}
	return false
}

checkError()
ready
hasOwnProperty
function checkError() {
	const foo = JSON.parse("{\"error\":null}")
	if (foo.hasOwnProperty('error')) {
		return true
	}
	return false
}

checkError()
ready
hasOwn
function checkError() {
	const foo = JSON.parse("{\"error\":null}")
	if (Object.hasOwn(foo, 'error')) {
		return true
	}
	return false
}

checkError()
ready

Revisions

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