Skip to content

Commit dfc944e

Browse files
author
Aziz
committed
Quiz: correct code sample typo
1 parent 06a249e commit dfc944e

File tree

1 file changed

+3
-3
lines changed
  • questions/what-are-the-benefits-of-using-spread-syntax-and-how-is-it-different-from-rest-syntax

1 file changed

+3
-3
lines changed

questions/what-are-the-benefits-of-using-spread-syntax-and-how-is-it-different-from-rest-syntax/en-US.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const newArray = [...array];
4141
console.log(newArray); // Output: [1, 2, 3]
4242

4343
// Copying objects
44-
const obj = { name: 'John', age: 30 };
44+
const person = { name: 'John', age: 30 };
4545
const newObj = { ...person, city: 'New York' };
4646
console.log(newObj); // Output: { name: 'John', age: 30, city: 'New York' }
4747
```
@@ -66,8 +66,8 @@ const obj2 = {
6666
qux: 'baz',
6767
};
6868

69-
const merged = { ...obj1, ...obj2 };
70-
console.log(copyOfTodd); // Output: { foo: "bar", qux: "baz" }
69+
const mergedObj = { ...obj1, ...obj2 };
70+
console.log(mergedObj); // Output: { foo: "bar", qux: "baz" }
7171
```
7272

7373
### Passing arguments to functions

0 commit comments

Comments
 (0)