Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function exerciseOne(){
  2. // Exercise One: In this exercise you will create a variable called 'aboutMe'
  3. // This variable should be assigned a new object
  4. // In this object create three key:value pairs
  5. // The keys should be: 'name', 'city', 'favoriteAnimal'
  6. // The values should be strings associated with the keys.
  7. // return the variable 'aboutMe'
  8. let aboutMe = {
  9.   name: 'Ramona',
  10.   city: 'Salt Lake',
  11.   favoriteAnimal: 'cat'
  12. };
  13.  
  14. return aboutMe;
  15. }
  16.  
  17. function exerciseTwo(animal){
  18. // Exercise Two: In this exercise you will be given an object called 'animal'
  19. // Create a new variable called 'animalName'
  20. // Accessing the animal object, assign the 'animalName' variable to the 'latinName' key on the object.
  21. // return the animalName variable.
  22. let animalName = 'foo';
  23. animal.latinName = animalName;
  24. return(animalName);
  25. };
  26.  
  27.  
  28. function exerciseThree(userObject){
  29. // Exercise Three: In this exercise you will be given an object called 'userObject'
  30. // The phonne number for this user is incorrect!
  31. // reassign the 'phoneNumber' key to the value: '(951)867-5309'
  32. // return the userObject
  33. userObject.phoneNumber = '(951)867-5309';
  34. return userObject;
  35. }o""U
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement