typeof vs angular.isDefined() (v6)

Revision 6 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<script>
var a;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
typeof undefined
if(typeof a !== 'undefined'){
 return true;
}
ready
angular.isDefined
if(angular.isDefined(a)){
 return true;
}
ready
if(a){
 return true;
}
ready

Revisions

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