-
-
Save ilearnjavascript/2e0b6d9c21ba434849a40644f2cb5c95 to your computer and use it in GitHub Desktop.
es6 - rest parameter - 1.js
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
var restParameter = function(firstname, lastname, ...adress) { | |
console.log('firstname: ', firstname); | |
console.log('lastname: ', lastname); | |
console.log('adress: ', adress); | |
} | |
restParameter('John', 'Doe', 'Example Street 1', '12345', 'Exampletown'); | |
// outputs: | |
// firstname: John | |
// lastname: Doe | |
// adress: ["Example Street 1", "12345", "Exampletown"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment