I am ramping up on some code and found this structure multiple times throughout the code: y && y.someProp && y.someFunction();
:
$rootScope.funct = function() {
$timeout(function() {
var y = service.doSomething();
y && y.someProp && y.someFunction();
});
} else {
var y = service.doSomething();
y && y.doSomethingElse();
}
};
What is the purpose of this? Does it stop execution of the program if both y && something else
both don't complete or are otherwise falsey?