- Notifications
You must be signed in to change notification settings - Fork111
Array methods#109
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
adriavieira314 wants to merge34 commits intojavascript-tutorial:masterChoose a base branch fromadriavieira314:master
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Array methods#109
Changes fromall commits
Commits
Show all changes
34 commits Select commitHold shift + click to select a range
9f60b54 Topic about splice translated
adriavieira314b545120 Minor changes on spelling
adriavieira3143682d91 Slice method translated
adriavieira314a515f5e Minor changes in spelling
adriavieira314d5e89d4 Minor changes in spelling
adriavieira3140fbf0ab Method concat translated
adriavieira314001de77 ForEach method translated
adriavieira314b754cce Searching in Arrays translated
adriavieira31401f5aeb Filter, map and sort methods translated
7313e2a Filter, map, sort, reverse, split and join methods translated
0de0510 Reduce method translated
709683d Minor changes
0769724 Minor changes
4e22c2e Array.isArray translated
9184f6c Minor spelling changes
588b6e9 Summary translated
ce7ce92 Minor spelling changes
8a4a64c Links changed to articles in portuguese
56545f4 Minor spelling changes
bba9814 solution.js translated
4e5f6b6 task camelcase translated
3c92031 Task filter range translated
c938a34 Task filter-range-in-place translated
0d4eebb Task sort translated
2283adc Task copy-and-sort translated
1570319 Task array-get-names translated
7cf4aa1 Task calculator translated
49cc586 Map objects task translated
10014f4 sort-objects task translated
dfaaada minor spelling changes
b464660 shuffle task translated
04c309e average-age task translated
be3a6e4 array-unique task translated
e654190 Titles from tasks translated
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
8 changes: 4 additions & 4 deletions1-js/05-data-types/05-array-methods/1-camelcase/_js.view/solution.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| function camelize(str) { | ||
| return str | ||
| .split('-') //separa 'my-long-word'em um array ['my', 'long', 'word'] | ||
| .map( | ||
| //deixa as primeiras letras de todos os itens doarrayem maiúsculo exceto o primeiro item | ||
| //converte ['my', 'long', 'word']em ['my', 'Long', 'Word'] | ||
| (word, index) => index == 0 ? word : word[0].toUpperCase() + word.slice(1) | ||
| ) | ||
| .join(''); //une ['my', 'Long', 'Word']formando 'myLongWord' | ||
| } |
10 changes: 5 additions & 5 deletions1-js/05-data-types/05-array-methods/1-camelcase/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions1-js/05-data-types/05-array-methods/10-average-age/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletions1-js/05-data-types/05-array-methods/11-array-unique/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions1-js/05-data-types/05-array-methods/11-array-unique/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion1-js/05-data-types/05-array-methods/2-filter-range/_js.view/solution.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| function filterRange(arr, a, b) { | ||
| //colchetes adicionado ao redor da expressão para melhor entendimento | ||
| return arr.filter(item => (a <= item && item <= b)); | ||
| } |
6 changes: 3 additions & 3 deletions1-js/05-data-types/05-array-methods/2-filter-range/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,14 @@ | ||
| ```js run demo | ||
| function filterRange(arr, a, b) { | ||
| //colchetes adicionado ao redor da expressão para melhor entendimento | ||
| return arr.filter(item => (a <= item && item <= b)); | ||
| } | ||
| let arr = [5, 3, 8, 1]; | ||
| let filtered = filterRange(arr, 1, 4); | ||
| alert( filtered ); // 3,1 (valores que coincidem com o que foi pedido) | ||
| alert( arr ); // 5,3,8,1 (array não foi modificada) | ||
| ``` |
10 changes: 5 additions & 5 deletions1-js/05-data-types/05-array-methods/2-filter-range/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion1-js/05-data-types/05-array-methods/3-filter-range-in-place/_js.view/solution.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions1-js/05-data-types/05-array-methods/3-filter-range-in-place/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions1-js/05-data-types/05-array-methods/3-filter-range-in-place/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions1-js/05-data-types/05-array-methods/4-sort-back/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion1-js/05-data-types/05-array-methods/5-copy-sort-array/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| Podemos usar`slice()`para fazer acópia e executar o método `sort()` logo depois: | ||
| ```js run | ||
| function copySorted(arr) { | ||
8 changes: 4 additions & 4 deletions1-js/05-data-types/05-array-methods/5-copy-sort-array/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions1-js/05-data-types/05-array-methods/6-array-get-names/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions1-js/05-data-types/05-array-methods/6-calculator-extendable/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| -Por favor,notecomo os métodos são armazenados. Eles são simplesmente adicionados no objeto interno. | ||
| -Todos os testes e conversões numéricas são feitas no método`calculate`. No futuro, pode ser extendida para suportar mais expressões complexas. |
27 changes: 15 additions & 12 deletions1-js/05-data-types/05-array-methods/6-calculator-extendable/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions1-js/05-data-types/05-array-methods/7-map-objects/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.