What is the purpose of the following expression: (a! == a && b! == b) in angularjs code?

I noticed the expression

(a! == a & b! == b)

in angularjs source code :

compare = function(a, b) { return a === b || (a !== a && b !== b); }; 

Isn't the expression always false? what is the reason to write something like that?

+7
javascript angularjs
source share

No one has answered this question yet.

See similar questions:

nine
Regular Expression Testing
3
How to find out why two objects are not compared with angular.equals?
one
When does a! == a?

or similar:

6493
var functionName = function () {} vs function functionName () {}
2201
How to decide when to use Node.js?
1498
What is the purpose of the var keyword and when should I use it (or omit it)?
1388
What is the purpose of Node.js module.exports and how do you use it?
1251
How to access mapped groups in JavaScript regex?
1001
Is Safari iOS 6 caching $ .ajax results?
998
What is the difference between "@" and "=" in scope in AngularJS?
969
What are the nuances of prototype / prototype inheritance volume in AngularJS?
931
How do you know which DOM element has focus?
531
What is the purpose of wrapping all Javascript files in anonymous functions like "(function () {...}) ()"?

All Articles