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.

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
221,902 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!