Last active
December 17, 2015 16:28
-
-
Save logosity/5638563 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
function listFruits(fs) { | |
fs.sort(); | |
for(var i in fs) { | |
console.log(fs[i]); | |
} | |
} | |
var fruits = ["Banana", "Orange", "Apple", "Mango"]; | |
listFruits(fruits); //prints Apple Banana Mango Orange each on their own line | |
console.log(fruits); //["Apple", "Banana", "Mango", "Orange"] ouch!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment