mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
fix: add missing return to example in rpg project step 146 (#53890)
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ if (score > 0) {
|
||||
}
|
||||
|
||||
// ternary operator
|
||||
score > 0 ? score : default_score
|
||||
return score > 0 ? score : default_score
|
||||
```
|
||||
|
||||
In `getMonsterAttackValue`, change `return hit` to a ternary operator that returns `hit` if `hit` is greater than `0`, or returns `0` if it is not.
|
||||
|
||||
Reference in New Issue
Block a user