Skip to content

Instantly share code, notes, and snippets.

@DiyahM
Last active August 29, 2015 14:25
Show Gist options
  • Save DiyahM/914da0497239c7fcb423 to your computer and use it in GitHub Desktop.
Save DiyahM/914da0497239c7fcb423 to your computer and use it in GitHub Desktop.
//page 3 changes
var myList = ['apple', 'orange' 'banana'];
var fruit = myList[2];
//page 5 changes
//question should change to 'What is the value returned in the above function printFavoriteColor?'
//This should be a text answer instead of multiple choice
function printFavoriteColor(){
var colors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple'];
var randomString = "";
for(var i=0; i<colors.length; i++) {
if (colors[i].length < 5)
randomString += colors[i];
else if (colors[i].length == 5)
randomString += colors[i];
else
randomString = colors[i];
}
return randomString;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment