Hash for less than 10 elements

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
test array
const array = ['marginBottom', 'isKidsPage', 'isStackable']

const result = array.includes('isStackable')
console.log(result)
ready
test hash hasOwnProperty
const hash = {'marginBottom': true, 'isKidsPage': true, 'isStackable': true}

const result = hash.hasOwnProperty('isStackable');
console.log(result)
ready
test hash in
const hash = {'marginBottom': true, 'isKidsPage': true, 'isStackable': true}

const result = 'isStackable' in hash;
console.log(result)
ready
test set
const set = new Set(['marginBottom', 'isKidsPage', 'isStackable'])

const result = set.has('isStackable')
console.log(result)
ready

Revisions

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