Skip to content

Latest commit

 

History

History
15 lines (8 loc) · 434 Bytes

File metadata and controls

15 lines (8 loc) · 434 Bytes

Default Parameters

sayHello() is using a Ternary Operator to check if person is defined.

If person is defined, it returns a greeting plus the persons name - "Hello, Laura!"

If the person is undefined, it returns "Hello, you!"

Can you shorten this function, using a default parameter?

To run the tests:

        npm test default_parameters.test.js

Hint: make sure you're in the correct folder before running this command