44 lines
795 B
HTML
44 lines
795 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
</head>
|
|
<body>
|
|
|
|
</body>
|
|
<script>
|
|
//ES5对象赋值时的写法
|
|
// let name="张一凡";
|
|
// let age=23;
|
|
// let address="翻斗花园";
|
|
// const app={
|
|
// name:name,
|
|
// age:age,
|
|
// address:address,
|
|
// }
|
|
//<--这是ES6对象增强写法-->
|
|
let name="张一凡";
|
|
let age=23;
|
|
let address="翻斗花园";
|
|
const app={
|
|
name,
|
|
age,
|
|
address,
|
|
}
|
|
//这是ES5函数的写法
|
|
const fun={
|
|
//这是ES5函数的写法
|
|
look:function(){
|
|
|
|
},
|
|
//这是ES6函数的写法
|
|
run(){
|
|
|
|
}
|
|
}
|
|
console.log(app);
|
|
</script>
|
|
</html> |