Last active
November 13, 2015 06:40
-
-
Save goodbedford/0fc278e5b6275a709181 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// you want to get a new puppy so you go to the puppy palace. you need to print out the list of | |
// all the puppies to make your choice. write a function that will | |
// do loops in three ways and print puppy name,breed and age to each to console. | |
// for loop, while loop, forEach | |
function puppyPrint () { | |
var puppies = [ | |
{name: "ruff", | |
breed: "beagle", | |
age: 1 | |
}, | |
{name: "bunny", | |
breed: "terrier", | |
age: 2 | |
}, | |
{name: "solo", | |
breed: "mix-breed", | |
age: 3 | |
} | |
]; | |
console.log("The For Loop"); | |
//your for loop below | |
//your while loop below | |
console.log("The While Loop"); | |
//your forEach below | |
console.log("forEach") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment