Skip to content
Snippets Groups Projects
Commit eec989d7 authored by Elmeri Hyvönen's avatar Elmeri Hyvönen
Browse files

Upload New File

parent 51268a5a
Branches
Tags
No related merge requests found
import React from 'react'
const Course = ( {course} ) => {
var total = course.parts.reduce(function(summa, harkat) {
return summa + harkat.exercises
}, 0 )
return (
<div>
<h1>{course.name}</h1>
{course.parts.map(x => <p>{x.name} {x.exercises}</p>)}
<p>{total}</p>
</div>
)
}
export default Course
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment