Skip to content

Commit 5d209da

Browse files
authored
Typo and rewording
1 parent e881277 commit 5d209da

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

README.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ function createTempFile(name) {
505505
```
506506
**[⬆ back to top](#table-of-contents)**
507507

508-
### Avoid Side Effects
508+
### Avoid Side Effects (part 1)
509509
A function produces a side effect if it does anything other than take a value in
510510
and return another value or values. A side effect could be writing to a file,
511511
modifying some global variable, or accidentally wiring all your money to a
@@ -550,12 +550,11 @@ console.log(newName); // ['Ryan', 'McDermott'];
550550
```
551551
**[⬆ back to top](#table-of-contents)**
552552

553-
### Avoid Side Effects pt.2
554-
Side effects could also occur from inside a function. In Javascript, function arguments
555-
are always passed by value except when they(functions) are passed reference values such as
556-
objects and arrays. In that case, we should be carefull not to change any of these
557-
argument's properties. A possible solution would be to always clone the variable,
558-
edit it and return the clone.
553+
### Avoid Side Effects (part 2)
554+
Side effects could also occur from inside a function. In JavaScript, primitives are
555+
passed by value and objects are passed by reference. In the later case, we should be
556+
careful not to change any of these argument's properties. A possible solution would
557+
be to always clone the variable, edit it and return the clone.
559558

560559
**Bad:**
561560
```javascript

0 commit comments

Comments
 (0)