Plumbiu 最近的时间轴更新
Plumbiu's repos on GitHub
TypeScript · 17 人关注
blog
Plumbiu's blog with material style
Vue · 11 人关注
record-your-life
Record your app usage, support windows, Linux and MacOS | 记录你的应用程序使用,支持 windows、Linux 和 MacOS
TypeScript · 2 人关注
hardware_manager
硬件管理系统
1 人关注
dress
好耶 是女装 | Unofficial fork of komeiji-satori/Dress.
JavaScript · 1 人关注
export-fetch
将导出的API地址转换为真正的API请求数据!
Vue · 1 人关注
fe_tensorflow
基于tensorflow开发的深度学习可视化网页
TypeScript · 1 人关注
form-tree
build tree with simple API.
TypeScript · 1 人关注
github-info
Github profile information by using API!
TypeScript · 1 人关注
html2toc
a super tiny library parsing html to toc!
TypeScript · 1 人关注
img-tools
Compress, transfrom and resize image with web ui and API
TypeScript · 1 人关注
md
parse md to html and generate toc!
TypeScript · 1 人关注
nextjs_tensorflow
基于 nextjs 和 tensorflow 的 web 展示页面
TypeScript · 1 人关注
prune-npm
优化你的 node_modules
TypeScript · 1 人关注
rollup-string-performance
transfrom startsWith and endsWith to one char compare
0 人关注
blogImg
博客图床
0 人关注
ByteDream-JueJin
Yet Another Blog In JueJin Style By ByteDream
0 人关注
consola
🐨 Elegant Console Logger for Node.js and Browser
0 人关注
destr
🚀 Faster, secure and convenient alternative for JSON.parse
JavaScript · 0 人关注
eslint-stylistic
Monorepo for ESLint Stylistic plugins and configs
TypeScript · 0 人关注
hardware_manager_nextjs
JavaScript · 0 人关注
hdu-cs-wiki
HDU计算机科学讲义
TypeScript · 0 人关注
heading-doc-parser
Simple doc parser for heading comment.
TypeScript · 0 人关注
js-benchmark
benchmark for JavasSript API
TypeScript · 0 人关注
login_signup
使用 prisma+express 实现的登录注册接口
JavaScript · 0 人关注
my-vue-app
JavaScript · 0 人关注
nextjs_weather_cartd
用NextJS重新构建的天气卡片
JavaScript · 0 人关注
Plumbiu
个人介绍捏
JavaScript · 0 人关注
read-glob-file
Read all files in the specified folder
JavaScript · 0 人关注
readme-word-cloud
word cloud for your README.md!
JavaScript · 0 人关注
rollup-plugins
🍣 The one-stop shop for official Rollup plugins
Plumbiu

Plumbiu

V2EX 第 631801 号会员,加入于 2023-05-30 21:44:05 +08:00
Plumbiu 最近回复了
22 天前
回复了 sudoy 创建的主题 Node.js nodejs 用户为什么这么爱变来变去呢?
版本不对锁版本呗
试试开发一下 antd ,看看卡不卡
@qrobot 我也有点不确定啊,感觉如果是两个请求在队列里,前面不知道会不会存在队头阻塞的情况,应该是你说的对,post 接口返回的时间不一样,可能执行顺序不同
@qrobot 哥你看一下 js 中的异步队列
@Plumbiu 如果用了计时器,定的时间不同另算
@qrobot 异步执行只有并行情况下结果才不确定吧,楼主都是依次调用 post 接口,按理来说异步队列里面也是依次执行的
@qrobot 是有闭包出现,但是主要的问题还是作用域吧,不是闭包出现了问题
@qrobot 类似的啊,var 没有块级作用域,你这个代码就会等同于:

```js
var i

// 同步任务
i = 0 -> 定时器等待打印 i
i = 1 -> 定时器等待打印 i
// ...
i = 100

// 异步任务
console.log(i) // i 为 100 ,打印 100 次
```

如果 var 改为 let

```js
// 同步任务
{ let i = 0; } -> 定时器等待打印 i
{ let i = 1; } -> 定时器等待打印 i
// ...
{ let i = 100; }
// 异步任务(在每个块级作用域执行)
{ console.log(i); } // i = 0
{ console.log(i); } // i = 1
```
@qrobot 效果都一样吧,我感觉楼主应该是想将一个文本中的图片地址替换成另外一个地址,这个最开始做不就应该写在循环外?没搞清楚楼主的做法
@qrobot forEach 不能用 async/await 的,我的理解就是作用域问题,看我上一个回答
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3267 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 17ms · UTC 11:42 · PVG 19:42 · LAX 04:42 · JFK 07:42
Developed with CodeLauncher
♥ Do have faith in what you're doing.