Created
July 23, 2017 16:09
-
-
Save prof3ssorSt3v3/9ee7efa0d5b7f8ef4cd9f4c9c8c3d817 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Default Function Parameters | |
// new ES6 feature allowing us to provide | |
//default values for function parameters | |
function sendMessage(email, message, title="message"){ | |
if(!email || !message){ | |
return false; | |
} | |
//title = title || ""; | |
//fancy code to send the message | |
title = title.toUpperCase(); | |
console.log(title); | |
console.log(message, '\n'); | |
return true; | |
} | |
sendMessage('fry@planetexpress.org', | |
'You got the raise!', | |
'Good news!'); | |
sendMessage('fry@planetexpress.org', | |
'nvm. My mistake. It was Scruffy who got the raise.'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment