Input Arguments

Let's get familiar with giving input arguments to functions.

We'll cover the following

Function arguments

When calling a function, a data value that’s passed to the function is called an argument.

Now, let’s modify our function from the previous lesson so that it accepts one input argument, which is a string containing the name that we want to say hello to. So, for example, we could call the function with writeMessage("Dave") and it would print to the screen Hello, Dave, or we could call it with writeMessage("Victoria") and it would write to the screen Hello, Victoria, etc:

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy