Skip to content

Commit cf79eee

Browse files
authored
sync improvements from clean-code-javascript repo (labs42io#29)
1 parent d2c0c5f commit cf79eee

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,11 @@ This has a few advantages:
314314

315315
1. When someone looks at the function signature, it's immediately clear what properties are being used.
316316

317-
2. Destructuring also clones the specified primitive values of the argument object passed into the function. This can help prevent side effects. Note: objects and arrays that are destructured from the argument object are NOT cloned.
317+
2. It can be used to simulate named parameters.
318318

319-
3. TypeScript warns you about unused properties, which would be impossible without destructuring.
319+
3. Destructuring also clones the specified primitive values of the argument object passed into the function. This can help prevent side effects. Note: objects and arrays that are destructured from the argument object are NOT cloned.
320+
321+
4. TypeScript warns you about unused properties, which would be impossible without destructuring.
320322

321323
**Bad:**
322324

@@ -365,7 +367,7 @@ createMenu({
365367

366368
### Functions should do one thing
367369

368-
This is by far the most important rule in software engineering. When functions do more than one thing, they are harder to compose, test, and reason about. When you can isolate a function to just one action, they can be refactored easily and your code will read much cleaner. If you take nothing else away from this guide other than this, you'll be ahead of many developers.
370+
This is by far the most important rule in software engineering. When functions do more than one thing, they are harder to compose, test, and reason about. When you can isolate a function to just one action, it can be refactored easily and your code will read much cleaner. If you take nothing else away from this guide other than this, you'll be ahead of many developers.
369371

370372
**Bad:**
371373

0 commit comments

Comments
 (0)