This commit is contained in:
Ilya Kantor 2017-06-03 09:28:50 +03:00
parent 99fb90e9f0
commit 90aa32338f

View file

@ -2,9 +2,9 @@ importance: 4
---
# Filter "in place"
# Filter range "in place"
Write a function `filterRangeInPlace(arr, a, b)` that gets an array `arr` and removes from it all values except those that are between `a` and `b. The test is: `a ≤ arr[i] ≤ b`.
Write a function `filterRangeInPlace(arr, a, b)` that gets an array `arr` and removes from it all values except those that are between `a` and `b. The test is: `a ≤ arr[i] ≤ b`.
The function should only modify the array. It should not return anything.
@ -16,4 +16,3 @@ filterRangeInPlace(arr, 1, 4); // removed the numbers except from 1 to 4
alert( arr ); // [3, 1]
```