From 3736cfa1302eb4b30e171cea90f2fadaf38bbfea Mon Sep 17 00:00:00 2001 From: idk <120068827+ConeDragon@users.noreply.github.com> Date: Fri, 12 Jul 2024 21:52:13 -0400 Subject: [PATCH 1/2] destructure parameteres --- .../.meta/exemplar.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/exercises/concept/elyses-destructured-enchantments/.meta/exemplar.js b/exercises/concept/elyses-destructured-enchantments/.meta/exemplar.js index 3af3244a8d..00477b1620 100644 --- a/exercises/concept/elyses-destructured-enchantments/.meta/exemplar.js +++ b/exercises/concept/elyses-destructured-enchantments/.meta/exemplar.js @@ -8,9 +8,7 @@ * * @returns {Card} the first card in the deck */ -export function getFirstCard(deck) { - const [first] = deck; - +export function getFirstCard([first]) { return first; } @@ -21,9 +19,7 @@ export function getFirstCard(deck) { * * @returns {Card} the second card in the deck */ -export function getSecondCard(deck) { - const [, second] = deck; - +export function getSecondCard([, second]) { return second; } @@ -46,9 +42,7 @@ export function swapTopTwoCards([a, b, ...rest]) { * @returns {[Card, Card[]]} the top card of the given * deck and a new deck containing all the other cards */ -export function discardTopCard(deck) { - const [first, ...rest] = deck; - +export function discardTopCard([first, ..rest]) { return [first, rest]; } From bbd22dda9dafeb8d48a95712588da40a4eb54365 Mon Sep 17 00:00:00 2001 From: idk <120068827+ConeDragon@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:02:14 -0400 Subject: [PATCH 2/2] add missing . --- .../concept/elyses-destructured-enchantments/.meta/exemplar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/concept/elyses-destructured-enchantments/.meta/exemplar.js b/exercises/concept/elyses-destructured-enchantments/.meta/exemplar.js index 00477b1620..748432b3a5 100644 --- a/exercises/concept/elyses-destructured-enchantments/.meta/exemplar.js +++ b/exercises/concept/elyses-destructured-enchantments/.meta/exemplar.js @@ -42,7 +42,7 @@ export function swapTopTwoCards([a, b, ...rest]) { * @returns {[Card, Card[]]} the top card of the given * deck and a new deck containing all the other cards */ -export function discardTopCard([first, ..rest]) { +export function discardTopCard([first, ...rest]) { return [first, rest]; }