Given this code:
const test = [1];
const test2 = 2;
const result = test.find((id) => id === 1) ?? "should not be this.";
console.log(result); // logs 1
const result2 = test.find((id) => id === 1) ?? true ? "true" : "false";
console.log(result2); // logs "true"
Why does the second log print “true” rather than 1? The left expression is not nullish so in my mind it is strange that the right hand turnery is even evaluated.
wrapping the turnery in parentheses works but it should not be needed?