hasOwn vs includes

Benchmark created on


Setup

const obj = {
	foo: "foo",
	bar: "bar",
	baz: "baz"
}

const key = "foo";

Test runner

Ready to run.

Testing in
TestOps/sec
object values includes
Object.values(obj).includes(key)
ready
object hasOwn
Object.hasOwn(obj, key)
ready

Revisions

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