Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Quickstart Functions Write a Function

Sami Sahebzada
Sami Sahebzada
72 Points

Inside the function, return the sum of the num parameter and 10?

function add10 (a, b){ function num(a, b) return a + b; } console.log(num(6, 4) );

1 Answer

Steven Parker
Steven Parker
231,269 Points

Looks like you got a bit off-track, here's some hints:

  • you should create only one function, named "add10"
  • the function should "accept one parameter called num" (instead of two named "a" and "b")
  • the function will add the number 10 to the single parameter
  • when you call the function in the last step, you don't need to log the output