- Notifications
You must be signed in to change notification settings - Fork179
Destructuring assignment#222
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
Merged
tarasyyyk merged 10 commits intojavascript-tutorial:masterfromhordiienko-tatiana:01-05-10-destructuring-assignmentNov 28, 2021
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
10 commits Select commitHold shift + click to select a range
9a53256
Destructuring assignment
hordiienko-tatiana148af75
Merge branch 'master' into 01-05-10-destructuring-assignment
hordiienko-tatiana0d62da3
Update 1-js/05-data-types/10-destructuring-assignment/1-destruct-user…
tarasyyyka4c5b0c
Update 1-js/05-data-types/10-destructuring-assignment/1-destruct-user…
tarasyyykda40e7e
Merge branch 'javascript-tutorial:master' into 01-05-10-destructuring…
hordiienko-tatianaf1b715d
Update 1-js/05-data-types/10-destructuring-assignment/1-destruct-user…
hordiienko-tatiana0256c50
Apply suggestions from code review
hordiienko-tatianae3a18d4
Apply changes from code review - 2
hordiienko-tatianaa1bd9c7
Apply code review changes - 3
hordiienko-tatiana5dff09d
Apply suggestions from code review
tarasyyykFile 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
4 changes: 2 additions & 2 deletions1-js/05-data-types/10-destructuring-assignment/1-destruct-user/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,13 +1,13 @@ | ||
```js run | ||
let user = { | ||
name: "Іван", | ||
years: 30 | ||
}; | ||
let {name, years: age, isAdmin = false} = user; | ||
alert( name ); //Іван | ||
alert( age ); // 30 | ||
alert( isAdmin ); // false | ||
``` |
22 changes: 11 additions & 11 deletions1-js/05-data-types/10-destructuring-assignment/1-destruct-user/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
18 changes: 9 additions & 9 deletions1-js/05-data-types/10-destructuring-assignment/6-max-salary/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,21 +2,21 @@ importance: 5 | ||
--- | ||
#Максимальна зарплата | ||
Є об’єкт`salaries`: | ||
```js | ||
let salaries = { | ||
hordiienko-tatiana marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
"Іван": 100, | ||
"Петро": 300, | ||
"Марія": 250 | ||
}; | ||
``` | ||
Створіть функцію`topSalary(salaries)`яка повертає ім’я найбільш високооплачуваної особи. | ||
-Якщо об’єкт`salaries`пустий, функція повинна повернути `null`. | ||
-Якщо є кілька високооплачуваних осіб, поверніть будь-якого з них. | ||
P.S.Використовуйте `Object.entries`і деструктурування для перебору пар ключ/значення. |
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.