Created
July 13, 2019 15:59
-
-
Save ohoroyoi/ddbd0a49fad25ee3f4f68610728dcbf0 to your computer and use it in GitHub Desktop.
이렇게 하면 순서가 어떻게 출력이 될까요?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getTodos = (id) => { | |
return new Promise((resolve, reject) => { | |
$.getJSON(`https://jsonplaceholder.typicode.com/todos/${id}`, (data) => { | |
resolve(data); | |
console.log(data); | |
}); | |
}); | |
} | |
// // 아래처럼 하면 순서보장 x | |
getTodos('1'); | |
getTodos('2'); | |
getTodos('3'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment