There was an error while loading. Please reload this page.
1 parent a02f505 commit 4879e29Copy full SHA for 4879e29
27-removeElement.js
@@ -0,0 +1,9 @@
1
+var removeElement = function (nums, val) {
2
+ for (let i = 0; i < nums.length; i++) {
3
+ if (nums[i] === val) {
4
+ nums.splice(i, 1);
5
+ i--;
6
+ }
7
8
+ return nums.length;
9
+};
0 commit comments