Demo promise JS Run

Code: Html | Auth: 03cd82
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var prm = new Promise(function (resolve, reject){
            console.log("Đang học 1");
            setTimeout(() => {
                console.log("Đã học xong, được phép đi lien hoan");
                return resolve("Đã đến nơi liên hoan");
            }, 3000);
            // return resolve("Đã đến nơi liên hoan");
        });

        console.log(prm);
        prm.then(function(data){
            
            console.log(data);      
            console.log(prm);
            console.log("Nâng cốc");
        })
        .then(function (){
            console.log("Nhậu xong, đi về thôi");
        })
        .then(function (){
            console.log("Đi ngủ");
        });

    </script>
</body>
</html>