摘要: 1. node.js创建服务器,接收get请求 var http = require('http');//我们使用 require 指令来载入 http 模块,并将实例化的 HTTP 赋值给变量 httpvar url = require('url');var querystring = requi 阅读全文
posted @ 2019-02-22 14:34 胖糖糖爱吃肉 阅读(636) 评论(0) 推荐(0) 编辑
摘要: 一、对象创建 1.对象字面量; 2.new创建对象; 3.Object.create()静态函数 阅读全文
posted @ 2018-11-12 16:21 胖糖糖爱吃肉 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 1.箭头函数没有 this,所以需要通过查找作用域链来确定 this 的值。箭头函数没有this,不能使用call(), apply(), bind()改变this; 2.没有arguments,访问外围函数的arguments function constant () { return () => 阅读全文
posted @ 2018-11-09 18:09 胖糖糖爱吃肉 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 1.定义:类似于数组,成员的值都是唯一的。 2.属性和方法 add(value) / delete(value) / has(value) / clear() 遍历方法:keys() / values() / entries() / forEach()。keys()、values()、entries 阅读全文
posted @ 2018-11-09 17:31 胖糖糖爱吃肉 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1.Map的学习 a.Map的定义:“值-值”,更完善的Hash结构; const m = new Map() const o = { p: 'hello Map' } m.set(o, 'content') const m = new Map(o) b.Map的实例属性与操作方法 map.size 阅读全文
posted @ 2018-11-09 16:36 胖糖糖爱吃肉 阅读(892) 评论(0) 推荐(0) 编辑
摘要: 1.类数组对象 a.定义 let arrayLike = { 0: 'name', 1: 'age', 2: 'sex', length: 3 } b.调用数组方法 Array.prototype.join.call(arrayLike , '&') Array.prototype.slice.ca 阅读全文
posted @ 2018-11-08 15:37 胖糖糖爱吃肉 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 1.闭包 a.即使创建它的上下文已经销毁,它依然存在; b.在代码中引用了自由变量(自由变量是指在函数中使用的,但既不是函数参数也不是函数的局部变量的变量)。 2.call和apply的模拟实现 Function.prototype.call = function (context) { conte 阅读全文
posted @ 2018-11-08 14:48 胖糖糖爱吃肉 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 1.forEach遍历数组,不能使用break/return退出循环,不要使用for in myArr.forEach ((item) => { }) 2. for-of循环,可以遍历数组、字符串、类数组对象、Map、Set for (var [key, value] of phontBookMap 阅读全文
posted @ 2018-11-05 15:01 胖糖糖爱吃肉 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1.el元素 render函数 html 2.vue实例的生成过程 参考https://segmentfault.com/a/1190000011381906 阅读全文
posted @ 2018-11-01 23:23 胖糖糖爱吃肉 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 1.实现原理 数据监听器observer 对对象的所有属性进行监听; 指令解析器Compile对每个节点进行解析,并绑定相应的更新函数 watcher是observer和compile之间的桥梁,收到属性变动的通知,执行更新视图。 参考:https://mp.weixin.qq.com/s?__bi 阅读全文
posted @ 2018-11-01 15:34 胖糖糖爱吃肉 阅读(103) 评论(0) 推荐(0) 编辑