Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit d208ba2

Browse files
committed
perf(isObject): use strict comparison
this is a micro-optimization based on http://jsperf.com/isobject4 no significant improvement in macro-benchmarks, but since it makes the code better it makes sense making this change.
1 parent de3f238 commit d208ba2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Angular.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,10 @@ function isDefined(value){return typeof value !== 'undefined';}
441441
* @param {*} value Reference to check.
442442
* @returns {boolean} True if `value` is an `Object` but not `null`.
443443
*/
444-
function isObject(value){return value != null && typeof value === 'object';}
444+
function isObject(value){
445+
// http://jsperf.com/isobject4
446+
return value !== null && typeof value === 'object';
447+
}
445448

446449

447450
/**

0 commit comments

Comments
 (0)