Back
TypeScript Compiler
Reset
Clear
Run
Code
type User = { name: string; points: number; }; const users: User[] = [ { name: "Asha", points: 12 }, { name: "Noah", points: 8 } ]; const total = users.reduce((sum, user) => sum + user.points, 0); console.log("Total points:", total);
STDIN (optional)
Args (space separated)
Output