Skip to content

Commit c938a34

Browse files
author
Adria Vieira
committed
Task filter-range-in-place translated
1 parent 3c92031 commit c938a34

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

1-js/05-data-types/05-array-methods/3-filter-range-in-place/_js.view/solution.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function filterRangeInPlace(arr, a, b) {
44
for (let i = 0; i < arr.length; i++) {
55
let val = arr[i];
66

7-
// remove if outside of the interval
7+
//remove se estiver fora do intervalo
88
if (val < a || val > b) {
99
arr.splice(i, 1);
1010
i--;

1-js/05-data-types/05-array-methods/3-filter-range-in-place/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function filterRangeInPlace(arr, a, b) {
44
for (let i = 0; i < arr.length; i++) {
55
let val = arr[i];
66

7-
// remove if outside of the interval
7+
//remove se estiver fora do intervalo
88
if (val < a || val > b) {
99
arr.splice(i, 1);
1010
i--;
@@ -15,7 +15,7 @@ function filterRangeInPlace(arr, a, b) {
1515

1616
let arr = [5, 3, 8, 1];
1717

18-
filterRangeInPlace(arr, 1, 4); // removed the numbers except from 1 to 4
18+
filterRangeInPlace(arr, 1, 4); // remove os números exceto números de 1 á 4
1919

2020
alert( arr ); // [3, 1]
2121
```

1-js/05-data-types/05-array-methods/3-filter-range-in-place/task.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ importance: 4
44

55
# Filter range "in place"
66

7-
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`.
7+
Escreva uma função `filterRangeInPlace(arr, a, b)` que pegue um array `arr` e remova dele todos os valores exceto aqueles que estão entre `a` e `b`. A condição é: `a ≤ arr[i] ≤ b`.
88

9-
The function should only modify the array. It should not return anything.
9+
A função deve modificar a array. Não deve retornar um valor.
1010

11-
For instance:
11+
Exemplo:
1212
```js
1313
let arr = [5, 3, 8, 1];
1414

15-
filterRangeInPlace(arr, 1, 4); // removed the numbers except from 1 to 4
15+
filterRangeInPlace(arr, 1, 4); // remove os números exceto números de 1 á 4
1616

1717
alert( arr ); // [3, 1]
1818
```

0 commit comments

Comments
 (0)