In the JS mentoring exemplar of Elyses Destructured Enchantments, there are a few inconsistencies with the function parameters, here are some of them:
export function swapTopTwoCards([a, b, ...rest]) {
return [b, a, ...rest];
}
export function discardTopCard(deck) {
const [first, ...rest] = deck;
return [first, rest];
}
In swapTopTwoCards
, it uses the destructuring syntax in the parameter, but in discardTopCard
, it does it inside the function.
Should I PR to change this?
Here’s also a screenshot: