Last active
February 21, 2019 01:34
-
-
Save doritostains/16ce136393350e4a883c3404936f85d3 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
| // 2. Given the following wheels and categories. Write a function named “wheelsWithCategories” | |
| // that produces the result below. | |
| const wheels = { | |
| wheels: [ | |
| { | |
| wheelID: 1, | |
| wheelCategory: 'OffRoad' | |
| wheelName: 'OffRoad One' | |
| }, | |
| { | |
| wheelID: 2, | |
| wheelCategory: 'Performance', | |
| wheelName: 'Performance two' | |
| } | |
| ] | |
| }; | |
| const categories = { | |
| categories: [ | |
| { | |
| name: 'OffRoad', | |
| Description: 'Off-Road' | |
| }, | |
| { | |
| name: 'Performance', | |
| Description: 'Performance wheels' | |
| }, | |
| ] | |
| }; | |
| // Output | |
| console.log(wheelsWithCategories(wheels, categories)); | |
| => { | |
| wheelsWithCategories: [ | |
| { | |
| wheelID: 1, | |
| wheelCategory: 'OffRoad', | |
| wheelName: 'OffRoad One', | |
| categoryInfo: | |
| { | |
| name: 'OffRoad', | |
| Description: 'Off-Road' | |
| } | |
| }, | |
| { | |
| wheelID: 2, | |
| wheelCategory: 'Performance', | |
| wheelName: 'Performance two', | |
| categoryInfo: | |
| { | |
| name: 'Performance', | |
| Description: 'Performance wheels' | |
| } | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment