Skip to content

Commit d23cf03

Browse files
committed
Add note to use destructuring
1 parent 2d66a5d commit d23cf03

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

exercises/concept/elyses-destructured-enchantments/.meta/exemplar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export function shiftThreeCardsAround([a, b, c]) {
5353
* @returns {Card[]} the pile named chosen
5454
*/
5555
export function pickNamedPile({ chosen }) {
56+
// 🚨 Do NOT use piles.chosen or piles.disregarded.
5657
return chosen;
5758
}
5859

@@ -64,6 +65,7 @@ export function pickNamedPile({ chosen }) {
6465
*/
6566
export function swapNamedPile({ chosen: disregarded, disregarded: chosen }) {
6667
// 🪄 Don't break the magic.
67-
// Do NOT touch the next line or Elyse will accidentally reveal the trick.
68+
// 🚨 Do NOT use piles.chosen or piles.disregarded.
69+
// 🚨 Do NOT touch the next line or Elyse will accidentally reveal the trick.
6870
return { chosen, disregarded };
6971
}

exercises/concept/elyses-destructured-enchantments/enchantments.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export function shiftThreeCardsAround(deck) {
5353
* @returns {Card[]} the pile named chosen
5454
*/
5555
export function pickNamedPile(piles) {
56+
// 🚨 Do NOT use piles.chosen or piles.disregarded.
5657
throw new Error('Implement the pickNamedPile function');
5758
}
5859

@@ -64,6 +65,7 @@ export function pickNamedPile(piles) {
6465
*/
6566
export function swapNamedPile(piles) {
6667
// 🪄 Don't break the magic.
67-
// Do NOT touch the next line or Elyse will accidentally reveal the trick.
68+
// 🚨 Do NOT use piles.chosen or piles.disregarded.
69+
// 🚨 Do NOT touch the next line or Elyse will accidentally reveal the trick.
6870
return { chosen, disregarded };
6971
}

exercises/concept/elyses-destructured-enchantments/enchantments.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const customInspectSymbol = Symbol.for('nodejs.util.inspect.custom');
1212
const customLogSymbol = Symbol.for('exercism.javascript.util.log');
1313

1414
// Follow the instructions in case you are stuck on "list.method is not a function"
15-
class LimitedArray {
15+
class LimitedDeck {
1616
constructor(values) {
1717
this.values = values;
1818
}
@@ -47,7 +47,7 @@ class LimitedArray {
4747
}
4848

4949
function deck(...values) {
50-
return new LimitedArray(values);
50+
return new LimitedDeck(values);
5151
}
5252

5353
describe('getFirstCard', () => {

0 commit comments

Comments
 (0)