first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>对象 object</title>
</head>
<body>
<script>
// var obj = new Object();
// obj.names = "张三"
// obj.age = "18"
// console.log(obj);
// var obj = new Object({
// names: '张三',
// age: "18"
// });
// var obj = {
// names: '张三',
// age: "18"
// }
// console.log(obj);
var cart = {
price: '25万',
color: 'red',
speed: '7',
opendoor: function() {
console.log("打开车门");
},
start: function () {
console.log("点火");
},
run: function () {
console.log("上路跑");
}
}
cart.opendoor()
cart.start()
cart.run()
// json
// 概念 object + array
// 他是一种描述数据格式和结构的方法,以前用 xml
// 作用:
// 前后端分离后后端把数据构造成json格式给前端前端拿到json渲染页面
var json1 = {
status: 200,
result: [
{
id: 1,
title: '今天天气很好'
},
{
id: 2,
title: '今天天气很好2222'
}
]
}
console.log(json1.result[0].title);
</script>
</body>
</html>