in vs typeof

Benchmark created by Timmy Willison on


Preparation HTML

<div></div>

Test runner

Ready to run.

Testing in
TestOps/sec
in
'getElementsByClassName' in document
ready
typeof
typeof document.getElementsByClassName === 'function'
ready
property
document.getElementsByClassName
ready
typeof undefined
typeof document.getElementsByClassName !== 'undefined'
ready

Revisions

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

  • Revision 1: published by Timmy Willison on
  • Revision 2: published on
  • Revision 3: published by Nikita Vasilyev on