Advertisement
Guest User

Untitled

a guest
Apr 9th, 2020
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function petSounds (animal, country) {
  2.   let objAnimal;
  3.   for (const i of animalNoises) {
  4.     if (i.hasOwnProperty(animal)) objAnimal = i[animal];
  5.     // if (i[animal] === animal) objAnimal = i[animal];
  6.     // for (const ani in i) {
  7.     //   if (ani === animal) objAnimal = i[ani];
  8.     // }
  9.   }
  10.   //console.log(objAnimal);
  11.   console.log(animal);
  12.   console.log(animalNoises[0][animal]);
  13.   //return `${animal}s in ${country} say ${objAnimal[country]}`;
  14. }
  15.  
  16. petSounds('cat', 'Algeria');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement