Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/WebDevSimplified/course-platform
/ sumArray
Function
sumArray
src/lib/sumArray.ts:1–3 ·
view source on GitHub ↗
(array: T[], func: (item: T) => number)
Source
from the content-addressed store, hash-verified
1
export
function
sumArray<T>(array: T[], func: (item: T) => number) {
2
return
array.reduce((acc, item) => acc + func(item), 0)
3
}
Callers
1
ProductPage
Function · 0.90
Calls
no outgoing calls
Tested by
no test coverage detected