let x = 0;
async function test() {
x += await 5;
console.log('x :', x);
}
test();
x += 1;
console.log('x :', x);
Run Code Online (Sandbox Code Playgroud)
x
记录的值为1
和5
。我的问题是:为什么x
5
第二个日志的值是?
如果test
是后执行x += 1
(因为它是一个异步函数),那么价值x
是1
由时间test
执行,所以x += await 5
应的值x
6
。
moment 库是否支持 EST、IST 等时区缩写的翻译。这些时区缩写在不同国家有不同的翻译/措辞吗?
javascript ×2
abbreviation ×1
async-await ×1
event-loop ×1
momentjs ×1
timezone ×1
translation ×1