You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
*/
let animals:string[] = ["Cow", "Goat", "Buffelo"];
for(let i:number = 0; i < animals.length; i++){
console.log(`${animals[i]} is a great pet in village`);
}
console.log(`These animals ${animals.map(animal => animal)} are common in many things like in milk and they all has four legs`);