We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 42b0a18 + 7336f93 commit 91c835eCopy full SHA for 91c835e
JavaScript_Basics/arrays.js
@@ -86,4 +86,13 @@ languages.slice(1, 3);
86
87
languages.slice(-3, -1);
88
// This selects languages[-3] to the element before languages[-1]
89
-// returns ["Python", "C"] which is the same as above
+// returns ["Python", "C"] which is the same as above
90
+
91
+// To get an array copy
92
+const arrayCopy = [...languages]
93
+// This ... copuy the array by value
94
+console.log(arrayCopy);
95
96
+// Get a reverse copy of array
97
+const reverseArray = languages.reverse();
98
+console.log(reverseArray);
0 commit comments