Files
ClassContent/历届学生/fontendseven/每天课程/2021-11-19/index.html
2024-09-27 02:06:13 +08:00

128 lines
2.3 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 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>
// return 返回方法的运行结果的
// 参数
// 无参方法
// 有参方法
// 匿名方法
// 作用域
// 全局作用域
// 局部作用域
// var a = 1;
// function test (num1,num2) {
// c = "2"; // 没有var涉及到 变量提升
// return num1 + num2;
// }
// var d = test;
// console.log( d(100,300) );
// console.log(c); // ??
// function c () {
// console.log(arguments);
// }
// c(10,11,1,2,13,15,16,25,678,5,333,673,355)
// 异步
// 1: 回调 callback 回调地狱 回调多层嵌套
// 2: promise
// 同步
// function a(callback) {
// var c = null;
// setTimeout(function() {
// c = "哈哈哈哈"
// callback(c)
// }, 3000)
// }
// a( function(d) {
// console.log(d);
// } )
// function demo(callback) {
// callback("demo")
// }
// demo(function (ddd) {
// console.log(ddd);
// })
// es5 来实现js没有的类的概念
// function ddd() {
// }
// 原型 prototype
// ddd.prototype.name = "张三"
// ddd.prototype.test = function () {
// return this.name;
// }
// console.log(ddd.prototype);
// console.log( new ddd().test() );
// es6 class 语法糖
// var name = "里斯"
// 继承 extends
// 封装
// 多态
// class test {
// hello = "还是说"
// }
// 子类 派生类
// 父类 基类
// class ddd extends test {
// name = "张三";
// // 构造函数,类被初始化的时候第一个走的方法
// // 参数的默认设置,用来接收参数
// constructor () {
// super()
// console.log("类被初始化了");
// }
// test () {
// return this.hello;
// }
// }
// var a = new ddd(); // 初始化一个类,得到 类的实列
// console.log( a.test() );
// this
// 指向问题
</script>
</html>