Created
September 22, 2019 15:24
-
-
Save niktariy/4b0b27a1afdf4a74c79fe6fad37f17e3 to your computer and use it in GitHub Desktop.
Example of function with named parameters
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
function logParams (first, second, third) { | |
console.log(first, second, third); | |
} | |
// first => 'Hello' | |
// second => 'World' | |
// third => '!!!' | |
logParams('Hello', 'World', '!!!'); // "Hello" "World" "!!!" | |
// first => { o: 3 } | |
// second => [ 1, 2, 3 ] | |
// third => undefined | |
logParams({ o: 3 }, [ 1, 2, 3 ]); // {o: 3} [1, 2, 3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment