Looking back at the eighth lesson - 2, to the constructor articles

Own nonsense code

<script>
    function Fuck() {
        this.c={
            ff:function () {
                return {
                    hi:function () {
                        return "."
                    }
                }
            }
        }
    }
    var gz=new Fuck();
    console.log(gz.c.ff().hi());
</script>

The constructor is very simple, mainly talk about this this

After this representative of the new object constructor is instantiated, this is only described herein in the constructor, this does not mean that other parts of the

During the execution of the constructor, it is constantly assigned to the properties and methods of the process of this new object.

 

Guess you like

Origin www.cnblogs.com/no000000/p/12294320.html