Created
June 7, 2021 17:55
-
-
Save appoll/af59654bc515ddc3a2a9fb9466e9d679 to your computer and use it in GitHub Desktop.
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
| // E1 | |
| // 1.1 Write a function that decreases the price of a book to half of its value | |
| // 1.2 Write a function that converts a book's authors' last name to lowercase | |
| // .toLower() | |
| // 1.3 Write a function that converts a book's authors' last name to uppercase | |
| // .toUpper() | |
| let b1 = { | |
| title: "Gone with the wind", | |
| price: 30, | |
| currency: "EUR", | |
| author: { | |
| lastName: "Anton" | |
| } | |
| } | |
| let b2 = { | |
| title: "The godfather", | |
| price: 40, | |
| currency: "USD", | |
| author: { | |
| lastName: "Holfeld" | |
| } | |
| } | |
| // this comes from the database | |
| let books = [b1, b2]; | |
| function lastNameToLower(book) { | |
| } | |
| function lastNameToUpper(book) { | |
| } | |
| function priceInHalf(book) { | |
| } | |
| books.forEach(lastNameToLower); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment