I want to set the variable notEmpty to true or false with a ternary operator, but my VSCode sonarlint marks it underlined in blue with the comment: Simplify this expression
Code:
const notEmpty = list.length > 0 ? true : false;
This actually works, but could be better.
try this:
no need to compare it to 0 as it returns 0 when it's empty which is false, otherwise it's true