- 👨💻 See the live version of this project at Library (Not Optimized For Mobile Yet)
This project is a part of The Odin Project's curriculum
-
How to use forms to collect data to then create an object from.
-
How to create objects in JS and how to manipulate their data.
-
What a an object's prototype is and how it effects object creation.
-
How to use data attributes on HTML elements.
- I wanted to create a book card "component" and at first I thought the easiest way would be to create a prototype function that creates all the HTML element's for me whenever I create a new object. The prototype function turned out way too long and messy, and had a lot of event listeners and it just wasn't ideal.
I knew that if I left this function as it is, if I came back to this project in a few month's from now to add something I would be completely confused by this function.
So I ditched the prototype function idea and created a new function, divided it to smaller and smaller functions that are easier to understand and read, and now the code is more organized and easier to understand.
P.S: if there is a better way to create a card component which I haven't discovered yet I will come back and change the funcntion again, so it's a work in progress :)