WDI Fundamentals Unit 10
If you don't see the JS Bin below, please refresh the page.
This time around, you won't be given any starter code. Instead, you'll need to write some functions from scratch using JS Bin's editor, based on the descriptions given below.
Let's get started!
Write the following functions:
sayHello, which accepts one parameter,
name. It should return a greeting to a person using his or her name (i.e., "Hello, name").
areBothEven, which accepts two parameters,
b. It should return
bare both even, or
false, if they are not.
hotOrNot, which accepts one parameter,
temp. It should return "hot", if
tempis above 75 degrees, or "not hot", if it is not.
threeIfNull, which accepts one parameter,
num. If num is
null, it should return 3. Otherwise, it should return the value of
greatest, which accepts three parameters (
c), and returns the one with the greatest value. For example,
greatest(5, 10, 1)would evaluate to 10.
Once you've written and tested all of these functions, go ahead and move on.
Stuck? Check out the solutions to see what you can do.