Created
December 30, 2020 21:06
-
-
Save peaceintheheart/ac403d2b566f0463756ef98eaf3bf336 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
Assume that `colors` in the function below will look something like the following: | |
[ 'Red', 'Yellow', 'White' ]; | |
*/ | |
// Require `addColorToPlant` here. | |
let addColorToPlant=require("./plants.js"); | |
function generateRosesByColor(colors) { | |
let result = []; | |
for (let i = 0; i < colors.length; i++) { | |
let color = colors[i]; | |
let rose = addColorToPlant({ name: "Rose" }, color); | |
result.push(rose); | |
} | |
return result; | |
} | |
// Export `generateRosesByColor` as a function (not an objct). | |
module.exports = generateRosesByColor; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment