Last active
October 13, 2015 15:35
-
-
Save imwithsam/306c7b56858b4df75934 to your computer and use it in GitHub Desktop.
Echo
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 echo1(myArray) { | |
if (Array.isArray(myArray)) { | |
myArray.forEach(function(element) { | |
console.log(element); | |
}); | |
} | |
} | |
function echo2() { | |
for(var i = 0; i < arguments.length; i++) { | |
console.log(arguments[i]); | |
} | |
} | |
echo1(); | |
echo1(['one']); | |
echo1(['one', 'two', 'three']); | |
echo2(); | |
echo2('one'); | |
echo2('one', 'two', 'three'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment