Files
ClassContent/历届学生/18课程/class18_2/课程/2020-12-22/index.html
2024-09-27 02:06:13 +08:00

132 lines
2.5 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 a = 1, b = "1"
// console.log(b-a); // 1+"2" 12
// ==(相等) ===(绝对相等)
// console.log(a===b); // false
// x++
// console.log(++a); // 1
// console.log(a); // 2
// console.log( (2 < 3) + a++ );
// console.log(a);
// var b = '<div class="header">' +
// '<div class="header_location">' +
// '<i class="iconfont icon-dingwei"></i>' +
// '<span>' + a + '</span>' +
// '<i class="iconfont icon-xiangxia"></i>' +
// '</div>';
// var c = `
// <div class="header">
// <div class="header_location">
// <i class="iconfont icon-dingwei"></i>
// <span>${a}</span>
// <i class="iconfont icon-xiangxia"></i>
// </div>
// <div class="header_search">
// <i class="iconfont icon-xinbaniconshangchuan-"></i>
// <span>搜索饿了么商家、商品名称</span>
// </div>
// </div>
// `
// console.log(c);
// + 数学运算 +字符串拼接
//
// var n = 78;
// switch (n) {
// case 78:
// console.log("凉");
// break;
// case 2:
// break;
// default:
// }
//for
// js 数组 array
// 1: var arr = new Array();
// arr[0] = 1
// var arr = new Array(1,2,3,4)
// var arr = [1,2,3,4]
// console.log(arr);
// for (var i = 0;i<arr.length;i++) {
// console.log(arr[i]);
// }
// arr.forEach( function(val,index) {
// console.log(index);
// } )
// 类的属性
// 类的方法
// class Utils {
// test() {
// }
// }
// var ddd = new Utils()
// ddd.test()
// es5es6789
// object
// var obj = {
// color: 'red',
// chuang: function() {
// console.log("穿衣服");
// }
// }
// console.log(obj.chuang());
// // obj.chuang()
// var a = function () {
// }
// a()
// function 封装具有相同功能的代码模块,解决代码复用
// var a = 1
// // var ff = "3e233"
// function test () {
// ff = "3e233"
// console.log(a) // 1
// }
// test();
// console.log(ff); //
</script>
</html>