Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

rovelle trinidad
390 PointsI really don't know what im doing
yeah
function add10(1) {
return num + 10;
};
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
1 Answer

Cooper Runstein
11,837 PointsI think what you're confused as to how arguments work in functions. Here's what you want:
function add10(num) { //This line is declaring function named add10 that takes an argument named num
return num + 10;
};
add10(1) //Call the add10 function and pass it the argument 1
You were trying to both create and call a function in one go, the point of functions is re-usability, you want to define the function in a way that can accept more than one argument, The code above will also let you pass 2 or 100 to the funciton.
reece tobin
Courses Plus Student 39 Pointsreece tobin
Courses Plus Student 39 PointsWhat you trying to do?