mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
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:
+2
-2
@@ -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--
|
||||
|
||||
|
||||
Reference in New Issue
Block a user