Skip to content

Commit 68df64e

Browse files
authored
Update spread-operator.mdx
1 parent b855500 commit 68df64e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/technologies/javascript/spread-operator.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ console.log(bookInfo);
121121
} */
122122
```
123123

124-
In the example above, the `bookInfo` object copies the properties of the `book` object by using the spread operator to copy the properties of the original `book` object into the `bookInfo` object.
124+
In the example above, the `bookInfo` object copies the properties of the `book` object by using the spread operator to copy the properties of the original `book` object into the `bookInfo` object.
125125

126126
### Merging objects properties
127+
127128
You can merge two or more objects into a single object using the spread operator (`...`). The spread operator provides a simple way to combine the properties of multiple objects into a single object without modifying the original objects.
128129

129130
To merge objects using the spread operator, spread each object inside curly braces `{}`. Consider the example below:
@@ -152,7 +153,9 @@ In the example above, the two objects - `info1` and `info2` are merged into one
152153

153154
### Updating object properties
154155

155-
You can also update the properties of an object with the JavaScript spread operator. To update an object's properties using the spread operator, you can spread the original object inside a new object, and specify the new values for the properties you want to update, like this:
156+
You can also update the properties of an object with the JavaScript spread operator.
157+
158+
To update an object's properties using the spread operator, you can spread the original object inside a new object, and specify the new values for the properties you want to update, like this:
156159

157160
```js
158161
const book = {

0 commit comments

Comments
 (0)