Last active
August 29, 2015 14:07
-
-
Save colintoh/9a2ab8b853b3e0f9615a 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
//Without Rest Parameters | |
function rollCall(){ | |
var names = Array.prototype.slice.call(arguments); | |
names.forEach(function(name){ | |
console.log(name); | |
}); | |
} | |
//With Rest Parameters | |
function rollCallWithRest(...names){ | |
names.forEach(function(name){ | |
console.log(name); | |
}); | |
} | |
rollCall("John","Mary"); | |
rollCallWithRest("James","May","Jeremy","Clarkson"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment