I came across this piece of code:
<a ng-click= "item.statusId !== itemStatus.in || transfer()">
I think we can generalize as:
<element ng-click = "someVar !== someValue || doStuff()">
Then I found this article on short circuits , and the other more focused as soon as I realized what they are called. However, I still do not understand.
Does it mainly work on the principle of evaluating the end of an OR statement if the first statement evaluates to true? So, if the first statement is true, completion of the evaluation, if it is false, run the function in the second half of the OR statement? (This is the main question I ask, everything else is additional).
I assume that the part that I am not getting is that the compiler interprets this code differently or it still evaluates false and just runs the function. Not even sure how the phrase Q.
source share