Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array methods [Tasks] Filter range "in place" typo #3612

Open
GaneshS288 opened this issue Nov 7, 2023 · 0 comments
Open

Array methods [Tasks] Filter range "in place" typo #3612

GaneshS288 opened this issue Nov 7, 2023 · 0 comments

Comments

@GaneshS288
Copy link

GaneshS288 commented Nov 7, 2023

https://javascript.info/array-methods#tasks (The page in question)

[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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant