clean-code-javascript icon indicating copy to clipboard operation
clean-code-javascript copied to clipboard

Add examples for pure functions and destructuring defaults

Open mohandand opened this issue 9 months ago • 0 comments

This PR adds two new best-practice examples to the guide:

  1. Pure Functions vs. Side Effects (in the Functions section)

    • Demonstrates the importance of avoiding side effects
    • Includes good vs. bad examples with clear reasoning
  2. Destructuring Defaults & Nested Destructuring (in the Objects and Data Structures section)

    • Shows how to provide safe defaults and avoid runtime errors
    • Includes clean parameter handling with modern syntax

mohandand avatar May 14 '25 02:05 mohandand