Code from the article, the second example:
// Longhand let test: boolean; if (x > 100) { test = true; } else { test = false; } // Shorthand let test = (x > 10) ? true : false;
It could be shorter, like the following:
let test = x > 10;
It could be not easy to read or understand several ternary operators in one and the same statement sometimes
Shorter not means better!
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.
Code from the article, the second example:
It could be shorter, like the following:
It could be not easy to read or understand several ternary operators in one and the same statement sometimes
Shorter not means better!