Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정홍주
/
Coin-trade-assistant
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
전현진
2021-06-07 22:50:46 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
222a8694d8d3b4aca8f8faa540025a24a53b9928
222a8694
1 parent
cddaf1e6
Delete test2.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
30 deletions
test2.js
test2.js
deleted
100644 → 0
View file @
cddaf1e
const
delay
=
()
=>
{
const
randomDelay
=
Math
.
floor
(
Math
.
random
()
*
4
)
*
100
return
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
randomDelay
))
}
const
loop
=
async
(
list
)
=>
{
console
.
log
(
"시작"
)
const
promises
=
list
.
map
(
async
data
=>
{
return
await
delay
()
.
then
(()
=>
data
)
})
const
results
=
await
Promise
.
all
(
promises
)
results
.
forEach
(
data
=>
console
.
log
(
data
))
console
.
log
(
"끝"
)
}
const
list
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
]
loop
(
list
)
// const result = async (list) => {
// for (const data of list) {
// await delay()
// .then(() => console.log(data))
// }
// }
// const list = [1, 2, 3, 4, 5, 6, 7]
// result(list)
\ No newline at end of file
Please
register
or
login
to post a comment