exercise 2.3

This commit is contained in:
Anish Lakhwara 2023-05-15 23:44:23 +10:00
parent b3572cb595
commit 10daad2d87

View file

@ -15,6 +15,7 @@ const Content = ({ parts }) => {
} }
const Sum = ({ parts }) => { const Sum = ({ parts }) => {
// Already used reduce :3
const total = parts.reduce((acc, currVal) => acc + currVal.exercises, 0) const total = parts.reduce((acc, currVal) => acc + currVal.exercises, 0)
return ( return (
<b>The total number of execrcises is {total}</b> <b>The total number of execrcises is {total}</b>