mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 23:44:11 +02:00
fix: typo in spread operator post
This commit is contained in:
@@ -66,7 +66,7 @@ const b = [3, 4];
|
||||
console.log([...a, ...b]); // [1, 2, 3, 4] - Merged!
|
||||
```
|
||||
|
||||
Here's a real-world example. Imagine that you're making a function which accepts an ``options`` object as argument, but you also what to have default values for this object. Here's a not so good way to do it without spread operator:
|
||||
Here's a real-world example. Imagine that you're making a function which accepts an ``options`` object as argument, but you also want to have default values for this object. Here's a not so good way to do it without spread operator:
|
||||
|
||||
```js
|
||||
const f = (opts) => {
|
||||
|
||||
Reference in New Issue
Block a user