Skip to content

Instantly share code, notes, and snippets.

@guilhermefarias
Created August 29, 2013 18:29
Show Gist options
  • Save guilhermefarias/6381657 to your computer and use it in GitHub Desktop.
Save guilhermefarias/6381657 to your computer and use it in GitHub Desktop.
Performance test: == or === ?
var t1,
t2,
test,
cont = 0,
element2 = 0,
element1 = '0';
t1 = performance.now();
while(cont < 2000000){
cont++;
test = (element1 === element2);
}
t2 = performance.now();
console.log(t2 - t1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment