Let's Say Hello
But we're going to get a bit fancy and show off different styles of greetings we can pass, with a default option set for us.
Testing out the function
Let's try running our function as a node script in terminal and see what happens!
So over here we have a lovely function called "sayHello" and then we're just going to do some stuff with it.
So let's try saying hello to me.
So if we come over here after saving our file and run our "cool-file.js", we see "Hello". Yay!
Now let's see what happens if we switch up the style of our hello to something like maybe "texas". Run it again... "howdy". [laughs] That's great.
What are all the different options of saying hello that you can use?
Here are the different styles that our sayHello function currently supports:
standard, which is the default, which includes a little waving emoji;
casual, which is all lowercase;
shout, which is all uppercase;
texas, which says "howdy" with a cowboy emoji;
and that's it. Otherwise we throw an error.
But we can always edit our function and add more if we want to.