You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 'between' in task description implies excluding numbers 1 and 4 so only 2 and 3 should be valid.
let arr = [5, 3, 8, 1];
filterRangeInPlace(arr, 1, 4); // removed the numbers except from 1 to 4
alert( arr ); // [3, 1]
Yet here we have 1 along with 3. The answer is also same as previous task filterRange. Please fix the wording or use an && operator in the solution.
The text was updated successfully, but these errors were encountered:
https://javascript.info/array-methods#tasks (The page in question)
[Filter range "in place"]
the 'between' in task description implies excluding numbers 1 and 4 so only 2 and 3 should be valid.
let arr = [5, 3, 8, 1];
filterRangeInPlace(arr, 1, 4); // removed the numbers except from 1 to 4
alert( arr ); // [3, 1]
Yet here we have 1 along with 3. The answer is also same as previous task filterRange. Please fix the wording or use an && operator in the solution.
The text was updated successfully, but these errors were encountered: