Input Arguments

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

Now let’s modify our function so that it accepts one input argument, which is a string containing the name 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