Vanilla JS how to update value in local storage array?

i am new to vanilla js and i followed a tutorial that was cut in half for a shopping cart but i managed to continue a bit but i couldnt find how to update a value in local storage array by pressing a button,can anyone help ? the function code:

function decrease() {             let cartItems = localStorage.getItem("productsInCart");             cartItems = JSON.parse(cartItems);                              } 

and below is a ss of my local storage; local storage

i need a command to update the amount of inCart decrease by 1

Professor Asked on October 18, 2020 in Android langue.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.