!! converts a value to a boolean (true or false). + then converts that boolean to a number, either 1 for true or 0 for false.
> +true
1
> +false
0
Personally I find it clearer to write something like this, when dealing with two booleans:
if (!config.template == !config.templateUrl) {
throw ...
}
Code clarity and readability be damned, apparently.