In angular JS I use the "isNull" function, the problem is that the value I put in it is not null but not defined. How can you make it behave as if the undefined value were null?
Asked
Active
Viewed 53 times
0
-
2Possible duplicate of [Undefined or null for AngularJS](https://stackoverflow.com/questions/17910192/undefined-or-null-for-angularjs) – Uwe Ohse Mar 19 '19 at 11:08
-
What is the isNull function ? AngularJS API doesn't provide it – Zooly Mar 19 '19 at 11:12
-
OP was probably referring to [`angular.isDefined`](https://docs.angularjs.org/api/ng/function/angular.isDefined), or the converse [`angular.isUndefined`](https://docs.angularjs.org/api/ng/function/angular.isUndefined). You really don't need these crufty functions. `value != null` (note the loose inequality) is sufficient to test for both `null` and `undefined`. – miqh Mar 19 '19 at 12:00