diff --git a/exercises/concept/elyses-looping-enchantments/.docs/instructions.md b/exercises/concept/elyses-looping-enchantments/.docs/instructions.md index 9111eb7b59..23979e0fa3 100644 --- a/exercises/concept/elyses-looping-enchantments/.docs/instructions.md +++ b/exercises/concept/elyses-looping-enchantments/.docs/instructions.md @@ -8,7 +8,11 @@ To keep things simple, she only uses cards with values 1-10. Elyse wants to know how many cards of a particular type she has in her deck. Write a function `cardTypeCheck` that takes two parameters: an array of cards (Elyse's deck) and the type of card to count. + + +~~~exercism/note The function should use `forEach` and return the number of cards in the deck of the specified type. +~~~ ```javascript const cardType = 3; @@ -23,7 +27,11 @@ For another trick, Elyse needs to know how many odd or even cards there are in h Implement a function `determineOddEvenCards` that takes in two parameters: an array of cards (Elyse's deck), and a boolean (true is analogous to 'even', and false is analogous to 'odd'). This function should return a single number: the number of odd or even cards there are (depending on the value of the second argument) in the deck. + + +~~~exercism/note To practice, use a `for...of` loop in the function implementation this time. +~~~ ```javascript determineOddEvenCards([1, 2, 3, 1, 5, 6], true); diff --git a/exercises/concept/elyses-looping-enchantments/enchantments.js b/exercises/concept/elyses-looping-enchantments/enchantments.js index 6f9ae7453e..4de26a6047 100644 --- a/exercises/concept/elyses-looping-enchantments/enchantments.js +++ b/exercises/concept/elyses-looping-enchantments/enchantments.js @@ -9,6 +9,7 @@ * @returns {number} number of cards of a single type there are in the deck */ export function cardTypeCheck(stack, card) { + // 🚨 Use .forEach throw new Error('Implement the cardTypeCheck function'); } @@ -20,5 +21,6 @@ export function cardTypeCheck(stack, card) { * @returns {number} number of cards that are either odd or even (depending on `type`) */ export function determineOddEvenCards(stack, type) { + // 🚨 Use a `for...of` loop throw new Error('Implement the determineOddEvenCards function'); }