typeof vs angular.isDefined() vs _.isUndefined (v10)

Revision 10 of this benchmark created on


Description

Checking native JS, Angular, and Lodash

Preparation HTML

<script src="//code.angularjs.org/snapshot/angular.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>

Setup

var a = 5;

Test runner

Ready to run.

Testing in
TestOps/sec
typeof undefined
typeof a !== 'undefined';
ready
angular.isDefined
angular.isDefined(a);
ready
lodash isUndefined
_.isUndefined(a);
ready

Revisions

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