콜백지옥

예시 요구사항

jquery 라이브러리 사용 예시

const callbackHellDemo = () => {
    $(document).ready(() => {
    $.ajax({
        url: "https://jsonplaceholder.typicode.com/posts/1",
        type: "GET",
        dataType: "json",
        success: () => {
        console.log("B");
        $.ajax({
            url: "https://jsonplaceholder.typicode.com/posts/1",
            type: "GET",
            dataType: "json",
            success: () => {
            console.log("C");
            $.ajax({
                url: "https://jsonplaceholder.typicode.com/posts/1",
                type: "GET",
                dataType: "json",
                success: (result) => {
                console.log("D");
                console.log(result);
                }
            });
            }
        });
        }
    });
    });

    console.log("A");
};