-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq35.js
More file actions
13 lines (13 loc) · 839 Bytes
/
q35.js
File metadata and controls
13 lines (13 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
// Animals: Think of at least three different animals that have a common characteristic. Store the names of these animals in a list, and then use a for loop to print out the name of each animal.
// • Modify your program to print a statement about each animal, such as A dog would make a great pet.
// • Add a line at the end of your program stating what these animals have in common. You could print a sentence such as Any of these animals would make a great pet!
var animals = ["Dogs", "Cats", "Rabbits"];
animals.forEach(function (animal) {
console.log(animal);
});
console.log("");
animals.forEach(function (animal) {
console.log("A ".concat(animal.toLowerCase(), " would make a great pet."));
});
console.log("They are all common household pets.");
console.log("Any of these animals would make a great pet!");