摘要: 二叉树的定义 /** * 二叉树 * @param {any} val * @param {BinaryTree} left * @param {BinaryTree} right */ function /*class*/ BinaryTree(val, left, right) { this.v 阅读全文
posted @ 2021-03-29 21:36 LiuWango 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 跟踪属性访问 const user = { name: 'Jack' } const userPorxy = new Proxy(user, { get(target, prop) { console.log(`Getting ${prop}`); return Reflect.get(...arg 阅读全文
posted @ 2021-03-29 09:52 LiuWango 阅读(447) 评论(1) 推荐(0) 编辑
摘要: 什么是严格模式 严格模式"use strict";是ES5新增的语法,在不支持严格模式的浏览器中,这行代码仅会被识别为一个“字面量表达式语句”,而在支持严格模式的浏览器中,这行代码表示在对应作用域内开启严格模式。 为什么要使用严格模式 启用严格模式后后,JavaScript引擎会对代码进行更加严格的 阅读全文
posted @ 2021-03-29 09:32 LiuWango 阅读(506) 评论(0) 推荐(0) 编辑