-
-
Notifications
You must be signed in to change notification settings - Fork 113
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Array methods #109
Changes from 35 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
9f60b54
Topic about splice translated
adriavieira314 b545120
Minor changes on spelling
adriavieira314 3682d91
Slice method translated
adriavieira314 a515f5e
Minor changes in spelling
adriavieira314 d5e89d4
Minor changes in spelling
adriavieira314 0fbf0ab
Method concat translated
adriavieira314 001de77
ForEach method translated
adriavieira314 b754cce
Searching in Arrays translated
adriavieira314 01f5aeb
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
af4e20f
Merge branch 'master' into master
gabifs 9d014ef
Apply suggestions from code review
gabifs 79c2d79
Apply suggestions from code review
gabifs 9c03478
Apply suggestions from code review
gabifs 4b5ba30
Apply suggestion from @gabifs
gabifs def0a09
Apply suggestion from @gabifs
gabifs 1eff808
Update 1-js/05-data-types/05-array-methods/article.md
gabifs a620b9b
Apply suggestions from code review
gabifs 902720d
Apply suggestion from @gabifs
gabifs f43933b
Apply suggestions from code review
gabifs 2cd18a6
Apply suggestions from code review
gabifs 1dde270
Apply suggestions from code review
gabifs 219bee6
Update 1-js/05-data-types/05-array-methods/article.md
gabifs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
1-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('-') // splits 'my-long-word' into array ['my', 'long', 'word'] | ||
| .split('-') // separa 'my-long-word' em um array ['my', 'long', 'word'] | ||
| .map( | ||
| // capitalizes first letters of all array items except the first one | ||
| // converts ['my', 'long', 'word'] into ['my', 'Long', 'Word'] | ||
| // deixa as primeiras letras de todos os itens do array em 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(''); // joins ['my', 'Long', 'Word'] into 'myLongWord' | ||
| .join(''); // une ['my', 'Long', 'Word'] formando 'myLongWord' | ||
| } |
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
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
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
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 deletion
2
1-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) { | ||
| // added brackets around the expression for better readability | ||
| // colchetes adicionado ao redor da expressão para melhor entendimento | ||
| return arr.filter(item => (a <= item && item <= b)); | ||
| } |
6 changes: 3 additions & 3 deletions
6
1-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) { | ||
| // added brackets around the expression for better readability | ||
| // 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 (matching values) | ||
| alert( filtered ); // 3,1 (valores que coincidem com o que foi pedido) | ||
|
|
||
| alert( arr ); // 5,3,8,1 (not modified) | ||
| alert( arr ); // 5,3,8,1 (array não foi modificada) | ||
| ``` |
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
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
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
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
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 deletion
2
1-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
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
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 deletions
4
1-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 @@ | ||
|
|
||
| - Please note how methods are stored. They are simply added to `this.methods` property. | ||
| - All tests and numeric conversions are done in the `calculate` method. In future it may be extended to support more complex expressions. | ||
| - Por favor, note como 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. |
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
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.
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.
Uh oh!
There was an error while loading. Please reload this page.