While working with JavaScript / Typescript, I often find myself needing to verify if a length exists or if a value is true or false.
So, the main query arises: are there any differences in performance or behavior when checking like this...
const data = ['hello', 'good', 'day'];
(data.length) // yields true
(data.length > 0) // also results in true
similarly
const booleanValue = false;
(!booleanValue) // returns true
(booleanValue === false) //also gives true
Is there an optimal approach for these checks or does it all come down to readability?