Last active
June 16, 2017 18:36
-
-
Save chadsten/c471c914655f8ac00b9658ee72f57584 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function myFunction() { | |
// no arguments present | |
console.log('Hellow World'); | |
} | |
myfunction(); // shows Hello World in the console | |
function myFunction(message) { | |
// one arguments present | |
console.log(message); | |
} | |
myfunction('Hello World'); // shows Hello World in the console | |
function myFunction(message = 'Hello World') { | |
// one arguments present | |
console.log(message); | |
} | |
myfunction(); // shows Hello World in the console | |
myfunction('Hello Austin!'); // shows Hello Austin! in the console | |
function myFunction(message, time) { | |
// two arguments present | |
if (time == now) { | |
console.log(message); | |
} else { | |
console.log('It is not time yet.'); | |
} | |
} | |
myfunction('Hello World', 'now'); // shows Hello World in the console | |
myfunction('Hello World', 'later'); // shows It is not time yet. in the console |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment