We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 444412a commit 63d7d7dCopy full SHA for 63d7d7d
README.md
@@ -251,3 +251,24 @@ const countMyFruits = myFruits.reduce((countFruits,fruit) => {
251
console.log(fruitsCounter)
252
// { Apple:3, Banana:1, Mango:2, Orange:1 }
253
```
254
+
255
256
+# Aliases with JavaScript Destructuring
257
258
259
+```javascript
260
261
+//There are cases where you want the destructured variable to have a different name than the property name
262
263
+const obj = {
264
+ name: "JSsnippets"
265
+};
266
267
268
+// Grabs obj.name as { pageName }
269
+const { name: pageName } = obj;
270
271
+//log our alias
272
+console.log(pageName) // JSsnippets
273
+```
274
0 commit comments