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

Elysha Spector
Elysha Spector
9,189 Points

Digital Literacy - JavaScript function

After the name of a function in JavaScript, within the parentheses, what type parameters/inputs could one use? Is there a clear list of examples easily available?

I am customizing my HTML/CSS/JavaScript project and would like to go a bit beyond what is being taught right now:

Example of code: <script type="text/javascript"> function doggybark() { document.getElementById('doggybark').play(); }

2 Answers

Steven Parker
Steven Parker
229,981 Points

Typical parameters to functions can include numbers, boolean values, strings, arrays, complex objects, and other functions. Anything that can be represented by a variable can be a function parameter.

Have you any programming experience in other languages? It's probably similar, but perhaps a bit more extensive (depending on the other language).

Elysha Spector
Elysha Spector
9,189 Points

Thank you Steven, this will help guide me into some additional research. I tend to get ahead of what I am learning sometimes.

In the past I had some Wordpress, Flash coding, Dreamweaver, and HTML/CSS lessens, but nothing extensive. I have decided to dive more into details by utilizing these courses.

I appreciate your quick response!