Use the information on Wikipedia's List of Fictional Dogs in Animated Television to create a literal object,
Question:
Use the information on Wikipedia's List of Fictional Dogs in Animated Television to create a literal object, a constructor, add a method to the object, and display the values. For each task, use comments to label steps as needed. Group comments whenever possible to keep the code readable.
Objective : An object using object literal and object constructor.
Use comments in your code identify each task
- Obj: An object literal
- Pick a favorite animal from Wikipedia'sList of Fictional Dogs in Animated Televisionand use at least 4 characteristics to create the object literalmyDog
- Obj: Add a property to an object after it is created.
- After the object is created, use a statement in your script that adds an additional property, call it "mySound". Do not change your original object declaration, use a seperate statement to add the property like we did in the live meeting. Assign the new property mySound a value that describes what the dog might say to represent its personality.
- For example, a mean dog might say "when you hear me you should be scared"
- a big dog might say "I sound very intimidating because of my size"
- a tiny dog might say "I'm meaner than I look Buster!"
- Feel free to use your imagination ...
3. Obj: Access the object values
Display the object's properties in a message similar to the example below (Mod5ExampleTex.png).
4. Obj: An object constructor
An object using an object constructor. Name the function myDogConst. You can use the same properties and values you used for the object literal, and include a new boolean property canTalk.
5. Obj: An method that displays a message.
Remember that a method is just a function stored as a property in an object.
A function that is stored in the object and call it myGreeting. Call the myGreeting method. It should display a greeting similar to the one below.
Hello, my name is Astro, when I bark I'm not scary. I starred in the tv show The Jetsons. My character was a Great Dane. I was the family dog in a cartoon about a family from the future
This the Wikipedia link https://en.m.wikipedia.org/wiki/List_of_fictional_dogs_in_animated_television This is Java script and the. Example above is what has to look like but different values
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last