Answer the question
In order to leave comments, you need to log in
How to delete a specific value in the localstorage array?
I have values in localstorage by key cartItems in the form of an array ["1", "2"] how can I specifically delete, for example, the second value, that is, "2"?
Answer the question
In order to leave comments, you need to log in
Only strings are stored in storage. Text.
JSON.parse(str)
and get arrayindexOf(valueToDelete)
splice()
this elementJSON.stringify(arr)
setItem(key, value)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question