Objectives and Skills
- Complete and debug code that uses objects
- Properties; methods; instantiation; Date object; retrieve date and time parts; localize date format (MM/DD vs DD/MM); add and subtract dates
- Create a web page that allows the user to enter book information for a bibliography. Include properties for title, author, year, publisher, city, and state. Respond to one or more user interface events to create an instance of a Book object and then display the book properties in APA format:
Last, F. M. (Year) Title. City, State: Publisher.
- Extend the program above by adding an APA method to your object that automatically formats the book for display. Use the APA method to format output, replacing the display code above.
- Extend the program above by adding an MLA method to your Book object that automatically formats the book for display. Display both APA and MLA formats for the book:
APA: Last, F. M. (Year) Title. City, State: Publisher.
MLA: Last, First M. Title. Publisher, Year.
- Extend the program above, allowing the user to enter multiple book titles, one at a time. Add each book to an array of books. Display the full array in APA and MLA format after each object is added to the array.
- Extend the program above, allowing the user to choose either APA or MLA format, and display the selected format for each book. List the books in alphabetical order.
- An object is a set of properties or methods. Each object holds related data.
- Objects are written in the name:value pair format. Each pair must be separated by a comma.
- Object properties may be accessed using the dot notation or the bracket notation.
- Fireship.io: Objects
- MDN: Working with Objects
- TutorialsPoint: What is the difference between a method and a function
- EasyBib:APA Book Reference
- EasyBib:MLA Book Reference
- MDNː Property accessors