Hi Henry and thanks for your article full of interesting advices!
When it comes to printing to the console by a predicate, I like to use one console and use the ternary operator inside the method call.
const value = 10; console.log(value !== 0 ? `Value is ${value}` : "No value");
This shorten the code a little bit more, while still keeping the conditional rendering of those strings.
Great point! This way definitely is more concise and readable.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
Hi Henry and thanks for your article full of interesting advices!
When it comes to printing to the console by a predicate, I like to use one console and use the ternary operator inside the method call.
This shorten the code a little bit more, while still keeping the conditional rendering of those strings.
Great point! This way definitely is more concise and readable.