fix: add missing return to example in rpg project step 146 (#53890)
parent
497d9792fd
commit
304a468ce1
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue