Description
In task 2. Add a new toy to the database, the code example doesn’t match the function the task asks you to implement.
- Wrong function name
The task asks you to implement createToy(name:amount:), but the example calls getName:
getName(name: “Doll”, quantity: 10) // Returns (name: “Doll”, quantity: 10)
- Mismatched parameter label
The signature uses amount as the second parameter label, but the example uses quantity. It’s unclear which one is intended.
Suggested fix
If the label should be amount, update the example to match the signature:
createToy(name: “Doll”, amount: 10) // Returns (name: “Doll”, quantity: 10)
If it should be quantity, update the signature and description to createToy(name:quantity:) instead.
Why it matters
The mismatch can confuse learners and cause their solution to fail the tests if the test suite expects a different label than the one shown in the example.