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

Revision 4 of this benchmark created on


Description

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

Setup

const set = new Set([
	'0-mail.com',
    '027168.com',
    '0815.su',
    '0sg.net',
    '10mail.org',
    '10minutemail.co.za',
    '11mail.com'
]);
const arr = [
	'0-mail.com',
    '027168.com',
    '0815.su',
    '0sg.net',
    '10mail.org',
    '10minutemail.co.za',
    '11mail.com'
];

Test runner

Ready to run.

Testing in
TestOps/sec
Set.has()
const isIn = set.has('0-mail.com');
ready
Array.includes()
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.