We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc499bb commit 75064eeCopy full SHA for 75064ee
1 file changed
app7.js
@@ -0,0 +1,12 @@
1
+const arr = ['value 1', 'value 2', 'value 3']
2
+const arr1 = arr.slice();
3
+
4
+console.log(arr.splice(1)); // ['value 2', 'value 3']
5
+console.log(arr); // ['value 1']
6
7
+console.log(arr1.splice(1,1,"new value 2")); // []
8
+console.log(arr1); // ['value 1', 'new value 2', 'value 3']
9
10
+arr1.splice(2,0, "ADD new value X");
11
+console.log(arr1); // ['value 1', 'new value 2',"ADD new value X", 'value 3']
12
0 commit comments