You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**2.3. Spreading elements together with an individual element:**
145
145
146
146
```js
147
-
let fruits = ["Apple", "Orange", "Banana"];
148
-
let newFruits = ["Cherry", ...fruits];
147
+
constfruits= ["Apple", "Orange", "Banana"];
148
+
constnewFruits= ["Cherry", ...fruits];
149
149
150
150
console.log(newFruits);
151
151
```
@@ -165,7 +165,7 @@ Output:
165
165
**2.4. Spreading elements on function calls:**
166
166
167
167
```js
168
-
let fruits = ["Apple", "Orange", "Banana"];
168
+
constfruits= ["Apple", "Orange", "Banana"];
169
169
170
170
constgetFruits= (f1, f2, f3) => {
171
171
console.log(`Fruits: ${f1}, ${f2} and ${f3}`);
@@ -217,7 +217,7 @@ Output:
217
217
Sets are a new object type with ES6 (ES2015) that allow to create collections of unique values. The values in a set can be either simple primitives like strings or integers, but more complex object types like object literals or arrays can also be part of a set.
0 commit comments