Files
ClassContent/历届学生/韩想/每日课程/2020-08-09/index.html
2024-09-27 02:06:13 +08:00

106 lines
1.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
<script>
var UserName = "张三"
const UserNames = "李四"
// 数据类型
// numberstringarrayobject nullundefinedfunction boolean
// var a = 1;
// var b = '2'; // "2"
// console.log(b-a); //
// + 两边都是number 加法
// + 只要有一个是string拼接字符串
// - 没有特殊情况
// array 数组
// let aa = new Array();
// aa[0] = "1"
// aa[1] = "2"
// aa[2] = "3"
// console.log(aa);
// var aa = new Array(1,2,"dewdew");
// console.log(aa);
// var aa = [1,2,3]
// aa.unshift(4)
// console.log(aa);
// var obj = new Object();
// var obj = new Object({ name: '李兵', age: 1 });
var obj = {
name: '李兵',
age: 1,
like: ['骑车','编程'],
hello: function() {
console.log("hello")
}
}
// let a = Object.keys(obj)
// console.log(a);
// for(var i=0;i< a.length;i++) {
// console.log(obj[a[i]]);
// }
// for (var key in obj) {
// console.log(obj[key])
// }
var a = ['好','22','我的娃'];
// a.forEach(function(val,index,arr){
// //console.log(val);
// })
let b = ['3ds','3dsadc']
// for (var index = 0; index < b.length; index++) {
// a.push(b[index])
// }
// a.concat(b)
// console.log(a);
// 扩展运算符
// console.log( [ ...a, ...b ] );
// obj.hasOwnProperty("love") // true false
// let text = "name"
// obj.hello()
// console.log(obj.text);
// console.log(obj[text]);
// var a = 1, b = 2;
// console.log(++a); // 2
// console.log(b--); // 2
// console.log(b); // 1
// console.log( ++(a--) - ( (a++) - (--b) ) ); //
</script>
</html>