I'm trying to leanr some javascript, however I can't quite answer why:
var a = 'xyz';
console.log('Example: ' + (a === 'xyz') ? 'A' : 'B');
Gives me back 'A' rather than Example: A. However when I put the whole if like that:
var a = 'xyz';
console.log('Example: ' + ((a === 'xyz') ? 'A' : 'B'));
It works flawlessly. Does that mean the first one puts the 'Example: ' string in a logical + with this if?