摘要: https://gitee.com/zjj9572/know 放在gitee上,自己慢慢写,尽量包括原理实现 阅读全文
posted @ 2020-10-24 21:50 尽世间恶丑 阅读(84) 评论(0) 推荐(0) 编辑
摘要: class EventBus { constructor() { this.events = {} } addEve (eventName,eventFn) { //console.log(this.events) this.events[eventName] = { eventFn, once:f 阅读全文
posted @ 2020-09-11 22:03 尽世间恶丑 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 链式调用 let obj = { a: 0, f1() { this.a += 1 console.log(this.a) return this }, f2() { this.a += 2 console.log(this.a) return this }, f3() { this.a += 3 阅读全文
posted @ 2020-09-10 15:08 尽世间恶丑 阅读(126) 评论(0) 推荐(0) 编辑
摘要: //promise:then,catch,finally,all,race // then时state还是pending等待状态 我们就需要在then调用的时候,将成功和失败存到各自的数组,一旦reject或者resolve,就调用它们,类似发布订阅 //pending,fulfilled,reje 阅读全文
posted @ 2020-09-09 16:20 尽世间恶丑 阅读(189) 评论(0) 推荐(0) 编辑
摘要: server 8081端口 let http = require('http'); let server = http.createServer((req, res) => { console.log("服务端已开启--8081端口") res.writeHead(200, { 'Content-T 阅读全文
posted @ 2020-09-05 16:06 尽世间恶丑 阅读(218) 评论(0) 推荐(0) 编辑
摘要: serverconst http = require('http') const url = require('url') http.createServer((req,res) => { let msg = '服务端消息' res.writeHead(200,{"Content-Type": "t 阅读全文
posted @ 2020-09-05 16:03 尽世间恶丑 阅读(142) 评论(0) 推荐(0) 编辑
摘要: http协议 是什么:Hyper Text Transfer Protocol超文本传输协议 基于TCP/IP通信来传递数据 协议分层 应用层(应用层为程序提供服务,表示层进行数据格式转化加密、会话层建立管理维护会话) 传输层建立管理维护端到端的连接 网络层找地址和路由 数据链路层提供介质访问 物理 阅读全文
posted @ 2020-09-05 16:02 尽世间恶丑 阅读(319) 评论(0) 推荐(0) 编辑
摘要: function Events(params) { this.events = [] } //订阅 Events.prototype.on = function (eventName,eventFn) { if(!this.events[eventName]) { //把事件存起来 ,有就push没 阅读全文
posted @ 2020-09-02 22:43 尽世间恶丑 阅读(188) 评论(0) 推荐(0) 编辑
摘要: https://mp.weixin.qq.com/s?__biz=MzU2NTc4NjM5OQ==&mid=2247486268&idx=1&sn=195357f0fe2035128e1c0f7db2d6c41b&chksm=fcb7294ccbc0a05aad896949392c406eab08e 阅读全文
posted @ 2020-08-30 15:58 尽世间恶丑 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 编译模块 效果//姓名:{{name}},年龄:{{age}},居住:{{addr.province}} //返回 姓名:mon,年龄:17,居住:dd //obj = { 姓名:mon,年龄:17,addr:{ province:'等等', city:'ddd' },} //只有嵌套对象没有数组 阅读全文
posted @ 2020-08-30 11:08 尽世间恶丑 阅读(178) 评论(0) 推荐(0) 编辑