includes vs logic

Benchmark created on


Setup

const request = {
	method: "GET"
};

Test runner

Ready to run.

Testing in
TestOps/sec
includes
if (["GET", "POST"].includes(request.method)) {
	// do stuff
}
ready
logic
if (request.method === "GET" || request.method === "POST") {
	// do stuff
}
ready

Revisions

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