摘要: var kClosest = function(points, K) { return points.reduce((a, p) ⇒ (p.d = Math.sqrt(p[0] * p[0] + p[1] * p[1]), a.concat([p])), []).sort((a, b) ⇒ a.d 阅读全文
posted @ 2022-01-24 16:53 guopeng1129972 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 修改 /usr/local/bin/n 中的NODE_MIRROR为淘宝地址 https://npm.taobao.org/mirrors/node N_NODE_MIRROR=\({N_NODE_MIRROR:-\){NODE_MIRROR:-https://nodejs.org/dist}} 改 阅读全文
posted @ 2021-03-10 23:58 guopeng1129972 阅读(1702) 评论(1) 推荐(0) 编辑
摘要: 没啥 就是想学 https://segmentfault.com/a/1190000017279102?utm_source=tag-newest https://www.cnblogs.com/caipeiyu/p/5507252.html 参考了2位道友的经验 还是要多记录呀(包括格式~~) 一 阅读全文
posted @ 2020-11-05 23:30 guopeng1129972 阅读(711) 评论(0) 推荐(0) 编辑
摘要: 部署Node.js环境(CentOS 7) 来自阿里云官方文档 https://help.aliyun.com/document_detail/50775.html 布骤二:部署Node.js环境 选择以下任意一种方法部署Node.js环境。 使用NVM安装多版本。 NVM(Node Version 阅读全文
posted @ 2020-11-03 16:28 guopeng1129972 阅读(470) 评论(0) 推荐(0) 编辑
摘要: 这个错误查了一下都是让关eslint的 我仔细想了下 其实没必要 有点本末倒置了 就是import 完之后 只能有一个空行 5 6两个空行 所以他报错了 删掉一个就好了 不用关eslit 如果你想问我为什么 不为什么 标准呗 😂 阅读全文
posted @ 2020-08-23 23:23 guopeng1129972 阅读(1664) 评论(0) 推荐(0) 编辑
摘要: 参照以下链接: https://blog.csdn.net/qq_36069339/article/details/104207101 现象就是: npm install 完之后node-sass报错 node_modules/node-gyp/gyp/gyp_main.py ode_modules 阅读全文
posted @ 2020-05-24 23:02 guopeng1129972 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 参照链接内容: https://blog.csdn.net/z15802933724/article/details/82346776 1.先清除npm缓存: npm cache clean -f 2.安装n模块: npm install -g n 报错 npm install -g n --for 阅读全文
posted @ 2020-05-24 22:34 guopeng1129972 阅读(919) 评论(0) 推荐(0) 编辑
摘要: 好多错 套中套 千层饼 用的npx create-react-app 创建的 说自带jest,我就写个jest测一下,看看 npx jest jest.test.js ok 没问题 npx jest jest.test.js --watch 报错 npm run test 报错 报的是 TypeEr 阅读全文
posted @ 2020-04-25 11:32 guopeng1129972 阅读(5122) 评论(0) 推荐(0) 编辑
摘要: 组合键 if ((window.event.ctrlKey)&&(window.event.keyCode==49)) alert("您按下了CTRL+1键"); 从以上例子可以看出,shift、Control、Alt 在JS中也可用“window.event.shiftKey”、“window.e 阅读全文
posted @ 2020-04-11 00:20 guopeng1129972 阅读(1554) 评论(0) 推荐(0) 编辑
摘要: altkey : 触发鼠标事件时是否alt 按键被按下,如果按下,则返回true,否则返回 fasle。 button: 事件属性返回一个阿拉伯数字 , 0代表 按下 左键 ,1 代表按下 滚轮 ,2 代表按下 右键。 offsetX、offsetY :事件属性返回触发事件时 鼠标相对于事件源元素 阅读全文
posted @ 2020-04-08 23:41 guopeng1129972 阅读(5515) 评论(0) 推荐(0) 编辑