Skip to content

Instantly share code, notes, and snippets.

@ohoroyoi
Created July 13, 2019 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ohoroyoi/0ffef3c8bc19fe5236e6f213b316d6ea to your computer and use it in GitHub Desktop.
Save ohoroyoi/0ffef3c8bc19fe5236e6f213b316d6ea to your computer and use it in GitHub Desktop.
할튼 콜백 내가 너 이해해버린다 이거임
$.getJSON('https://jsonplaceholder.typicode.com/todos/1', (data) => {
console.log(data);
});
const getTodos = (id, onSuccess) => {
$.getJSON(`https://jsonplaceholder.typicode.com/todos/${id}`, (data) => {
// console.log(data);
onSuccess(data);
});
};
getTodos('1', (data) => {
console.log(data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment