HELP! JS Advanced Shopping Cart - Тестове ОК -> Judge 0/100
Здравейте, колеги. Видях няколко решения на задачата, но при тях се добавят "event Listener"-и на всеки отделен бутон "Аdd". По насоки на лектора се опитвам да я реша по друг начин и да сложа само един "eventListener" (на father елемента на всички бутони "Аdd") и чрез проверка да установя дали clic-a идва от някой от бутоните "Аdd".
На компютъра ми работи, минават нулевите тестове, а получавам 0/100 в Judge.
Някой би ли ми помогнал да разбера къде бъркам?
https://pastebin.com/9ypkbhiR
You will be given some products that you should be able to add to your cart. Each product will have a name,
picture and a price.
When the Add button is clicked, append the current product to the textarea in the following format: Added
{name} for {money} to the cart.\n. The price must be fixed to the second digit.
When the button Checkout is clicked, calculate the total money that you need to pay for the products that are
currently in your cart. Append the result to the textarea in the following format:
You bought {list} for {totalPrice}.
The list should contain only the unique products, separated by " ,". The total price should be rounded to the
second decimal point.
Also, after clicking over Checkout and every from above is done you should disable all buttons. (You can not add
products or checkout again, if once checkout button is clicked)