默认localStorage只能存取字符串
那么如何存取数组呢
let newlist = [] localStorage.setItem('recent', JSON.stringify(newlist)) let list = JSON.parse(localStorage.getItem('recent'))
默认localStorage只能存取字符串
那么如何存取数组呢
let newlist = [] localStorage.setItem('recent', JSON.stringify(newlist)) let list = JSON.parse(localStorage.getItem('recent'))