I am using the below code to add a key-value pair to the existing localStorage
object.
But it is not adding a new pair
var students = []
var key = 'shop/elasticCache/sku$$' + this.product.parentSku
var student1 = { books: 1 }
students.push(student1)
var old = []
old = localStorage.getItem(key)
localStorage.setItem(key, JSON.stringify(old) + JSON.stringify(students))
console.log(JSON.parse(key)))