Few days ago, I tried several approaches to code my shopping cart.
None of them worked.
Surprisingly... It did not work.
Yesterday, late at night, I "cheated" and I asked a solution to my personal Aristotele version 2.0 :
The answer was OF COURSE given on stack overflow:
Asked 10 years, 7 months ago - Active 24 days ago - Viewed 1.1m times"
So I am not alone anymore. Scrolling down the page my savior: Andy Lorenz gave me the code I was looking for since one week.
Day34: 28 August 2020
Started my Pomodoro and I coded this few magical lines and TA-DA.
He uses a different approach, and I didn't think it was possible:
using the localStorage interface, he adds a function to its prototype.
I continued to code the entire evening, and before dinner, I had a video call with my OpenClassRooms mentor. He suggested to me to look at the fetch method (so I can convert my XMLHttpRequest into a chain of promises) and the template HTML tag. He showed to me how to code the cart using a class and how to use the bind method. I ignored how the bind method was important and so I asked to Google again:
I am thrilled to announce that I have finally finished writing my first book:
**Link to tweet:**