JS——级联的分析

版权声明:进击的葱 https://blog.csdn.net/qlwangcong518/article/details/86317329

描述:

JS——级联的分析

实现:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        class Box{
            constructor(){

            }
            a(){
                console.log("a");
                return this;
            }
            b(){
                console.log("b");
                return this;
            }
            c(){
                console.log("c");
                return this;
            }
        }


//        let box=new Box();
//        box.a().b().c();
        new Box().b().a().c();
    </script>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/qlwangcong518/article/details/86317329