Skip to content

Instantly share code, notes, and snippets.

@robertoandres24
Last active March 25, 2019 20:38
Show Gist options
  • Save robertoandres24/69197b77b9bc8a57622b37faf90110b2 to your computer and use it in GitHub Desktop.
Save robertoandres24/69197b77b9bc8a57622b37faf90110b2 to your computer and use it in GitHub Desktop.
let sum = course.lessons
.map(l => l.contents)
.reduce((acc, val) => acc.concat(val), [])
.reduce((acc, val) => {
return acc + val.length
}, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment