Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d6fd4ae

Browse files
committed
optimize await usage
1 parent 7fc4e8f commit d6fd4ae

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

‎JS/JS-br.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,9 @@ var obj = {a: 1, b: {
630630
}}
631631
// pay attention that this method is asynchronous
632632
// it can handle `undefined` and circular reference object
633-
const clone = await structuralClone(obj);
633+
(async () => {
634+
const clone = await structuralClone(obj)
635+
})()
634636
```
635637
636638
# Modularization

‎JS/JS-ch.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,9 @@ var obj = {a: 1, b: {
671671
}}
672672
// 注意该方法是异步的
673673
// 可以处理 undefined 和循环引用对象
674-
const clone = await structuralClone(obj);
674+
(async () => {
675+
const clone = await structuralClone(obj)
676+
})()
675677
```
676678

677679
# 模块化

‎JS/JS-en.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,9 @@ var obj = {a: 1, b: {
630630
}}
631631
// pay attention that this method is asynchronous
632632
// it can handle `undefined` and circular reference object
633-
const clone = await structuralClone(obj);
633+
(async () => {
634+
const clone = await structuralClone(obj)
635+
})()
634636
```
635637
636638
# Modularization

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /