//To store array of object in local storage
var msgObj ={
'msg': 'Kiran G',
'date':new Date().toLocaleString().replace(",", "")
}
let msgArr = JSON.parse(localStorage.getItem('msg')) ? JSON.parse(localStorage.getItem('msg')) : []
msgArr.push(msgObj)
localStorage.setItem('msg', JSON.stringify(msgArr))