graykode

(add) javascript file examples

1 +diff --git a/function.js b/function.js
2 +new file mode 100644
3 +index 0000000..ba89d9a
4 +--- /dev/null
5 ++++ b/function.js
6 +@@ -0,0 +1,6 @@
7 ++function getIntoAnArgument() {
8 ++ var args = arguments.slice();
9 ++ args.forEach(function(arg) {
10 ++ console.log(arg);
11 ++ });
12 ++}
13 +\ No newline at end of file
1 +diff --git a/function.js b/function.js
2 +index ba89d9a..d440734 100644
3 +--- a/function.js
4 ++++ b/function.js
5 +@@ -1,6 +1,3 @@
6 +-function getIntoAnArgument() {
7 +- var args = arguments.slice();
8 +- args.forEach(function(arg) {
9 +- console.log(arg);
10 +- });
11 ++function getIntoAnArgument(...args) {
12 ++ args.forEach(arg => console.log(arg));
13 + }
14 +\ No newline at end of file