Skip to content

Instantly share code, notes, and snippets.

@willie-hung
Last active August 2, 2023 19:32
Show Gist options
  • Save willie-hung/e2f071899a640d0f9544bf91e0cabe8a to your computer and use it in GitHub Desktop.
Save willie-hung/e2f071899a640d0f9544bf91e0cabe8a to your computer and use it in GitHub Desktop.
post_32
// Purpose: Function to sum a list of numbers.
export default function sum(...args: number[]): number {
return args.reduce((a, b) => a + b, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment