![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Javascript
文章平均质量分 57
神仙收容所所长
这个作者很懒,什么都没留下…
展开
-
Node.js学习笔记
1、文件操作 ①文件的基本操作 import * as fs from 'fs'; // 回调函数一般是异步的 // 文件操作一般都是错误优先回调函数 fs.mkdir('made-by-fs', err => { if (err) console.log('文件夹已经存在'); else console.log('文件夹创建成功'); }) fs.rename('./made-by-fs', './log', err=>{ if (err) console.转载 2022-02-27 23:02:02 · 551 阅读 · 0 评论 -
Js-Promise异步编程
1、什么是异步编程 // 开启一个多线程 // 如果网络请求很慢,那么就会先处理这个任务 // 然后遇到io阻塞的时候去接着处理 // 类似于开启了一个多线程, // 举个例子:家里的洗衣服,做饭,打扫卫生 // 我们不能一直等洗衣机洗完衣服然后再去做饭 // 所以这时就开始了多线程 2、异步加载图片初体验 function loadImg(url, resolve, reject) { // 创建图片的对象 let img = new Image(); // 设置图片的原创 2022-02-09 12:42:03 · 988 阅读 · 0 评论 -
Js-随笔学习
1、禁止用户复制文档文字 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <p>test</p> <script> document.body.oncopy = function (){ ale原创 2022-02-09 20:58:51 · 362 阅读 · 0 评论 -
Js-数据结构与算法(非完整)
1、栈的结构实现 class Stack { constructor() { this.items = []; } push(element) { this.items.push(element); } pop() { return this.items.pop(); } peek() { return this.items[this.items.length - 1]原创 2022-02-15 11:28:15 · 569 阅读 · 0 评论 -
Js-正则表达式
1、初体验正则表达式 let hd = 'houdunren2200hdcms9988' console.log(parseInt(hd)); // ---> NaN: not a number console.log(Number.isNaN(parseInt(hd))); // true let numbers = [...hd].filter(value => !Number.isNaN(parseInt(value))); console.log(numbers.join(''原创 2022-02-18 21:26:22 · 693 阅读 · 0 评论