mirror of
https://gitlab.com/lecarore/breakout71.git
synced 2025-04-20 20:16:16 -04:00
Wip : adventure mode
This commit is contained in:
parent
395968bc52
commit
6cf8fabf16
14 changed files with 457 additions and 114 deletions
|
@ -14,7 +14,7 @@ export function sample<T>(arr: T[]): T {
|
|||
return arr[Math.floor(arr.length * Math.random())];
|
||||
}
|
||||
|
||||
export function sumOfKeys(obj: { [key: string]: number } | undefined | null) {
|
||||
export function sumOfValues(obj: { [key: string]: number } | undefined | null) {
|
||||
if (!obj) return 0;
|
||||
return Object.values(obj)?.reduce((a, b) => a + b, 0) || 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue