Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code seems to be logical but returns empty string
Message
 
 
À
29/07/2015 09:56:22
Information générale
Forum:
Javascript
Catégorie:
Débogage
Divers
Thread ID:
01622609
Message ID:
01622643
Vues:
36
>>Well, I already re-wrote the code. I was mostly interesting in the explanation of that behavior.
>
>Without the brackets the value being tested by the '?' is formTitle+$scope.isNew - that results in a string which is cast to a Boolean. Any non-empty string evaluates to true.

In other words, the + operator takes precedence over the iif operator. This is important to know and keep in mind. Somehow it was not very clear to me.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform