JavaScript JavaScript Loops, Arrays and Objects Tracking Multiple Items with Arrays Useful Array Methods

Rick Rana
Rick Rana
7,484 Points

function print(message) { } ?

I think I need a refresher. :( Is (message) simply a placeholder? I don't see a message variable in the code. If so, does it get updated when the message parameter is replaced and the function is called? Thanks.

3 Answers

Steven Parker
Steven Parker
176,322 Points

:point_right: In a function definition, the parameter names represent the actual arguments that will be provided when the function is called. The name of any parameter is not important, but as a general practice a name is often chosen that reflects what the variable is used for within the function.

Cindy Lea
PRO
Cindy Lea
Pro Student 6,482 Points

Message is a parameter that will be referenced in the code when it is written. As is, it simply is saying the message will be passed to the function and the function will print it out.

Rick Rana
Rick Rana
7,484 Points

Great answers. Thank you for clearing that up.