From a2f012cbe6128facc2fdaef8bc35694513a1f2ef Mon Sep 17 00:00:00 2001 From: Abhinandan <93651229+AE-Hertz@users.noreply.github.com> Date: Wed, 31 Jul 2024 13:11:34 +0530 Subject: [PATCH 1/2] Update README_EN.md added JS solution for 2621 , https://leetcode.com/problems/sleep/ --- solution/2600-2699/2621.Sleep/README_EN.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/solution/2600-2699/2621.Sleep/README_EN.md b/solution/2600-2699/2621.Sleep/README_EN.md index 4d33630e3513d..13207f57fe898 100644 --- a/solution/2600-2699/2621.Sleep/README_EN.md +++ b/solution/2600-2699/2621.Sleep/README_EN.md @@ -69,6 +69,26 @@ async function sleep(millis: number): Promise { + + + +#### JavaScript +```js +/** + * @param {number} millis + * @return {Promise} + */ +async function sleep(millis) { + return new Promise ( r => setTimeout(r,millis)) +} + +/** + * let t = Date.now() + * sleep(100).then(() => console.log(Date.now() - t)) // 100 + */ + + + From 0b4d76782849e951d2f252cdde1b84b429e67fc6 Mon Sep 17 00:00:00 2001 From: AE-Hertz Date: Wed, 31 Jul 2024 08:12:18 +0000 Subject: [PATCH 2/2] style: format code and docs with prettier --- solution/2600-2699/2621.Sleep/README_EN.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/solution/2600-2699/2621.Sleep/README_EN.md b/solution/2600-2699/2621.Sleep/README_EN.md index 13207f57fe898..5a728253ff546 100644 --- a/solution/2600-2699/2621.Sleep/README_EN.md +++ b/solution/2600-2699/2621.Sleep/README_EN.md @@ -69,10 +69,10 @@ async function sleep(millis: number): Promise { - #### JavaScript + ```js /** * @param {number} millis @@ -82,7 +82,7 @@ async function sleep(millis) { return new Promise ( r => setTimeout(r,millis)) } -/** +/** * let t = Date.now() * sleep(100).then(() => console.log(Date.now() - t)) // 100 */ @@ -92,3 +92,4 @@ async function sleep(millis) { +```