JavaScript has a built-in method to help you with this. For-of and For-in loops are a great way to iterate over an array or object without having to manually keep track of the index of the keys of the object.

β€’3m read timeβ€’From tapajyoti-bose.medium.com
Post cover image
Table of contents
7 Shorthand Optimization Tricks every JavaScript Developer Should Know 😎1. Multiple string checks2. For-of and For-in loops3. Falsey checks4. Ternary operator5. Function calls6. Switch shorthand7. Fallback values
15 Comments

Sort: