Hey man, some of those are great (love the console.log shorthand), thanks for sharing.
I agree with some comments around the cleverness rather than the clearness of some of this examples.
I personally doubt about 7 too.
Despite I am familiar with the && operator, which I think pretty much everyone is familiar with when dealing with layout files (jsx, tsx), I prefer to go with the good old known friend if then -> doSomething();
In general when I write let's say business logic, I prefer to attach to the conditional semantics improved by the word if (and the block of course), which I think is also more legible.
Just a thought.
Cheers
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey man, some of those are great (love the console.log shorthand), thanks for sharing.
I agree with some comments around the cleverness rather than the clearness of some of this examples.
I personally doubt about 7 too.
Despite I am familiar with the && operator, which I think pretty much everyone is familiar with when dealing with layout files (jsx, tsx), I prefer to go with the good old known friend if then -> doSomething();
In general when I write let's say business logic, I prefer to attach to the conditional semantics improved by the word if (and the block of course), which I think is also more legible.
Just a thought.
Cheers