Set.has() vs Array.includes() (v2)

Revision 2 of this benchmark created on


Description

Compare Set.has() vs Array.includes() performance

Test runner

Ready to run.

Testing in
TestOps/sec
Set.has()
const set = new Set([
	'0-mail.com',
    '027168.com',
    '0815.su',
    '0sg.net',
    '10mail.org',
    '10minutemail.co.za',
    '11mail.com'
]);
const isIn = set.has('0-mail.com');
ready
Array.includes()
const arr = [
	'0-mail.com',
    '027168.com',
    '0815.su',
    '0sg.net',
    '10mail.org',
    '10minutemail.co.za',
    '11mail.com'
];
const isIn = arr.includes('0-mail.com');
ready

Revisions

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