mercredi 14 décembre 2016

Proper term for 'if (object)' as a non-null test?

In ActionScript 3, you can check if a value exists like this:

if (object) {
    trace("This object is not null, undefined, or empty!")

I frequently use this as a shorthand for if (object != null)

Is there a proper term for evaluating objects for null in this fashion? I suppose it's a matter of the Boolean typecasting rules for the language but I'm not sure if there's a name for the resulting syntax.

Aucun commentaire:

Enregistrer un commentaire