Use Ternary Operators for Simple Conditions
Writing verbose if-else statements for simple conditions makes code harder to read and maintain.
Use the ternary operator (condition ? true : false) for single-line conditional assignments.
Reduces code length by up to 70% and improves readability for simple conditions.