03 2021 档案

摘要:【初始化项目】 mkdir react_ts_eslint cd react_ts_eslint npm init 【生成ts配置文件】 tsc --init 【安装相关依赖】 npm install typescript webpack webpack-cli webpack-dev-server 阅读全文
posted @ 2021-03-25 15:34 KG-work-space 阅读(113) 评论(0) 推荐(0) 编辑
摘要:{ // 环境定义了预定义的全局变量。 "env": { //环境定义了预定义的全局变量。更多在官网查看 "browser":true, "node":true, "commonjs":true, "amd":true, "es6":true, "mocha":true }, // JavaScri 阅读全文
posted @ 2021-03-25 15:32 KG-work-space 阅读(314) 评论(0) 推荐(0) 编辑
摘要:本文将自定义_pop和_shift来模拟数组的pop和shift方法 _pop: /* *js中数组的pop方法:删除数组的最后一个元素,把数组的长度减1,并且返回删除的这个元素;如果数组为空,则pop()不改变数组,并且返回undefined; */ Array.prototype._pop=fu 阅读全文
posted @ 2021-03-10 11:14 KG-work-space 阅读(475) 评论(0) 推荐(0) 编辑
摘要:人话不多,直接上代码,在代码中解析,不足之处请谅解: push() Array.prototype._push=function(...value){//在Array原型链上添加_push方法 for(var i=0;i<arguments.length;i++){//按索引从小到大循环数组 thi 阅读全文
posted @ 2021-03-08 18:35 KG-work-space 阅读(677) 评论(0) 推荐(0) 编辑