<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="js/jquery-3.5.1.min.js"></script>
</head>
<body>
<script>
var todoList = [
{title: '我今天吃八个馒头', done: false},
{title: '我今天学习JQuery', done: true}
]
localStorage.setItem('todo', todoList)
/*本地存储里面只能存储字符串的数据格式*/
/*把数组转换成字符串 JSON.stringify()*/
localStorage.setItem('todo', JSON.stringify(todoList))
var data=localStorage.getItem('todo');
// console.log(data)
/*转换为原来的对象*/
var data_2=JSON.parse(data);
console.log(data_2[0].title)
</script>
</body>
</html>