From 00685d6f2ffd3249439c5f765ecb8f831feeb42c Mon Sep 17 00:00:00 2001 From: idk <120068827+ConeDragon@users.noreply.github.com> Date: Wed, 24 Jul 2024 08:01:46 -0400 Subject: [PATCH] destructure parameters (#2507) * destructure parameteres * add missing . --- .../.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..748432b3a5 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]; }