标签: javascript html5 local-storage
Q是自我解释的,只是想查看if语句。
答案 0 :(得分:2)
是的,试试这个
localStorage.length === 0
答案 1 :(得分:2)
localStorage has a length property:
localStorage
length
if (localStorage.length === 0) { // empty }