摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>继承</title> <script> // 将多个类中的重复代码提取出来 class Animal{ constructor(name, age) { thi 阅读全文
posted @ 2022-11-05 20:41 前端导师歌谣 阅读(112) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>类</title> <script> class MyClass{ constructor() { // this.fn = this.fn.bind(this 阅读全文
posted @ 2022-11-05 20:41 前端导师歌谣 阅读(12) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>类</title> <script> /* * 类 * - 类是对象的模板 * - 类决定了一个对象中有哪些属性和方法 * - 使用class关键字来定义一个类 阅读全文
posted @ 2022-11-05 20:41 前端导师歌谣 阅读(17) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>箭头函数</title> <script> /* * 1.箭头函数中没有arguments * 2.箭头函数中没有自己的this * - 它的this总是外层作 阅读全文
posted @ 2022-11-05 20:41 前端导师歌谣 阅读(31) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>箭头函数</title> <script> /* * 箭头函数 * - 只有一个参数的函数 * 参数 => 返回值 * - 如果没有参数,或多个参数,参数需要使 阅读全文
posted @ 2022-11-05 20:41 前端导师歌谣 阅读(49) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>展开</title> <script> /* * 可以通过 ... 展开一个数组 * */ function fn(a, b, c) { return a + 阅读全文
posted @ 2022-11-05 20:41 前端导师歌谣 阅读(37) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>解构赋值</title> <script> // let a, b; let arr = ['孙悟空', '猪八戒']; /* a = arr[0]; b = 阅读全文
posted @ 2022-11-05 20:41 前端导师歌谣 阅读(75) 评论(0) 推荐(0)
摘要: <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <title>变量</title> <script> /* * var * - 没有块级作用域 * let * - 有块级作用域 * const * - 和let类似,具有块 阅读全文
posted @ 2022-11-05 20:41 前端导师歌谣 阅读(44) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-11-05 20:41 前端导师歌谣 阅读(19) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-11-05 20:41 前端导师歌谣 阅读(9) 评论(0) 推荐(0)