chore(curriculum): update setPowers instructions in Build Superhero App Form workshop (#61108)

Co-authored-by: Ilenia <26656284+ilenia-magoni@users.noreply.github.com>
This commit is contained in:
Giftea ☕
2025-06-27 18:05:02 +01:00
committed by GitHub
parent 63a0676412
commit fefbfd7c58
@@ -7,9 +7,9 @@ dashedName: step-18
# --description--
Below the destructured `value` and `checked`, call the `setPowers` function to update the list of checked powers.
Below the destructured `value` and `checked`, update the list of checked powers.
The function needs an array argument. In the function parameter, use a ternary operator to check if `checked` is true. If it is, spread in the existing `powers` array into a new array and add the `value` to it. If it is not true, filter out the `value` from `powers` with `powers.filter(p => p !== value)`.
Call the `setPowers` function, which takes an array argument. Use a ternary operator to check if `checked` is true. If it is, spread the existing `powers` array into a new array and add the `value` to it. If it is not true, filter out the `value` from `powers` with `powers.filter(p => p !== value)`.
# --hints--