Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function exerciseOne(){
- // Exercise One: In this exercise you will create a variable called 'aboutMe'
- // This variable should be assigned a new object
- // In this object create three key:value pairs
- // The keys should be: 'name', 'city', 'favoriteAnimal'
- // The values should be strings associated with the keys.
- // return the variable 'aboutMe'
- let aboutMe = {
- name: 'Ramona',
- city: 'Salt Lake',
- favoriteAnimal: 'cat'
- };
- return aboutMe;
- }
- function exerciseTwo(animal){
- // Exercise Two: In this exercise you will be given an object called 'animal'
- // Create a new variable called 'animalName'
- // Accessing the animal object, assign the 'animalName' variable to the 'latinName' key on the object.
- // return the animalName variable.
- let animalName = 'foo';
- animal.latinName = animalName;
- return(animalName);
- };
- function exerciseThree(userObject){
- // Exercise Three: In this exercise you will be given an object called 'userObject'
- // The phonne number for this user is incorrect!
- // reassign the 'phoneNumber' key to the value: '(951)867-5309'
- // return the userObject
- userObject.phoneNumber = '(951)867-5309';
- return userObject;
- }o""U
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement