AngularJS Built-in helper Functions angular.isNumber

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

The angular.isNumber function returns true if and only if the object or value passed to it is of the type Number, this includes +Infinity, -Infinity and NaN

angular.isNumber(value)

This function will not cause a type coercion such as

"23" == 23 // true 

Examples

angular.isNumber("23") // false
angular.isNumber(23) // true
angular.isNumber(NaN) // true
angular.isNumber(Infinity) // true

This function will not cause a type coercion such as

"23" == 23 // true 


Got any AngularJS Question?