# Equality Comparisons (v15)

## Setup

``````const numbers = [];
const numbersNan = [];
const booleans = [];
const strings = [];
const objs = [];
const objsMega = [];

for(let i=0; i<1000; i++) {
numbers.push(i);
numbersNan.push(i%2 ? Number.NaN: 1);
booleans.push(i%2 == 0);
strings.push('' + i);
objs.push({});
objsMega.push({
['_' + i]: i
});
}``````

## Test runner

Testing in
TestOps/sec
numbers ==
``````let sum = false;
for (let i = 0; i< numbers.length; i++) {
sum ||= numbers[i] == numbers.at(-i - 1);
}``````
numbers ===
``````let sum = false;
for (let i = 0; i< numbers.length; i++) {
sum ||= numbers[i] === numbers.at(-i - 1);
}``````
strings ==
``````let sum = false;
for (let i = 0; i< strings.length; i++) {
sum ||= strings[i] == strings.at(-i - 1);
}``````
strings ===
``````let sum = false;
for (let i = 0; i< strings.length; i++) {
sum ||= strings[i] === strings.at(-i - 1);
}``````
objs ==
``````let sum = false;
for (let i = 0; i< objs.length; i++) {
sum ||= objs[i] == objs.at(-i - 1);
}
``````
objs ===
``````let sum = false;
for (let i = 0; i< objs.length; i++) {
sum ||= objs[i] === objs.at(-i - 1);
}``````
objsMega ==
``````let sum = false;
for (let i = 0; i< objsMega.length; i++) {
sum ||= objsMega[i] == objsMega.at(-i - 1);
}``````
objsMega ===
``````let sum = false;
for (let i = 0; i< objsMega.length; i++) {
sum ||= objsMega[i] === objsMega.at(-i - 1);
}``````
numbersNan ==
``````let sum = false;
for (let i = 0; i< numbersNan.length; i++) {
sum ||= numbersNan[i] == numbersNan.at(-i - 1);
}``````
numbersNan ===
``````let sum = false;
for (let i = 0; i< numbersNan.length; i++) {
sum ||= numbersNan[i] === numbersNan.at(-i - 1);
}``````
null ==
``````let sum = false;
for (let i = 0; i< numbersNan.length; i++) {
sum ||= numbers[i] == null;
sum ||= numbersNan[i] == null;
sum ||= booleans[i] == null;
sum ||= strings[i] == null;
sum ||= objs[i] == null;
sum ||= objsMega[i] == null;
}``````
null === || undefined ===
``````let sum = false;
for (let i = 0; i< numbersNan.length; i++) {
sum ||= numbers[i] === null || numbers[i] === undefined;
sum ||= numbersNan[i] === null || numbersNan[i] === undefined;
sum ||= booleans[i] === null || booleans[i] === undefined;
sum ||= strings[i] === null || strings[i] === undefined;
sum ||= objs[i] === null || objs[i] === undefined;
sum ||= objsMega[i] === null || objsMega[i] === undefined;
}``````