I was reviewing the code for an angularjs factory to better understand how it works. The code contains an if statement that I don\'t fully understand.
if
I
if ((+!!config.template) + (+!!config.templateUrl) !== 1) { 0 + 0 !== 1 true 0 + 1 !== 1 false 1 + 0 !== 1 false 1 + 1 !== 1 true
is equal to
if (!config.template === !config.templateUrl) {
despite the content of the two properties.