

想请教一下关于获取计时器内部数据的问题
source link: https://www.v2ex.com/t/793012
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

function a (){
let a = 0
a = 1
let loader = setInterval(function () {
abc ()
clearInterval(loader)
}, 1000)
function abc (){
a +=1
}
return a
}
我的预想是 return 的 a 为 2,但是现在 return 的结果依旧是 1,请问这个该怎么解决啊
Recommend
-
94
问与答 - @GeekJason - 首先祝各位新年快乐,身体健康,万事如意^_^寒假快结束了,我想买返校的高铁票,但一直处于没票状态,只剩几张商务票。迫生,只打算买学生票,所以来请教一下各位大佬这种情况是否可以买到学生票:我的学
-
5
这么晚了还有大佬在线吗?请教一下关于手机设备唯一识别码的问题
-
9
V2EX › 程序员 关于一个扣费设计问题,请教一下 v 站的各位大佬 zaczhou · 2 天前 · 739...
-
6
V2EX › Java Gradle 大佬请进,请教一下参数获取问题 samin · 7 小时 45 分钟前 · 193 次点击
-
11
V2EX › NAS 关于家用 nas,请教一下 linshuizhaoying · 14 小时 15 分钟前...
-
8
请教一下关于split风格的结果数量不对的问题。 ...
-
10
V2EX › 程序员 请教一下各位,关于如何实现文章转为视频 allentt · 1 天前 · 1063 次点...
-
15
V2EX › DNS 请教一下大家关于 dnsmasq 查找上游 DNS 的两个问题 zhoudaiyu · 14 小时 42 分钟...
-
2
V2EX › 程序员 关于 gRPC 的问题请教一下各位 hidemyself · 8 小时 40 分钟前 · 548...
-
3
关于BenchMark/c++11计时器/Chrome:tracing 的一些笔记
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK