I've noticed a weird behavior with .some() array method and a ternary operator.
It behaves differently when the integer(count) has to be incremented on each true case with and without the curly brackets.
Although, the console.log shows correct truthy on each iteration.
Any thoughts?
> let arr = ['011','202','3300']
undefined
> let count = 0;
undefined
> arr.some(k => k.includes('0') ? count++ : null);
true
> count;
2 // is not correct
> count = 0;
0
> arr.some(k => {k.includes('0') ? count++ : null});
false
> count;
3 // correct
>
> arr.some(k => {k.includes('0') ? console.log('true') : null});
true
true
true
false
> arr.some(k => k.includes('0') ? console.log('true') : null);
true
true
true
false