1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

prototype vs __proto__ : Are these statements correct?

Discussion in 'JavaScript' started by kayut, Jul 23, 2018.

  1. #1
    Hi,
    I'm trying to understand a couple of different things. I read a lot and googled for hours. Now, I need to connect all those infos and hope that you can help me by answering this question.

    Looking at this code:

    
    
        function Point(x, y) {
            this.x = x;
            this.y = y;
        }
    
        var myPoint = new Point();
    
    Code (markup):
    Are the following statements correct?:

    1. Point is a Constructor function object.

    2. myPoint is an instance of Point object.

    4. Point is the constructor of myPoint.

    5. myPoint doesn't have a prototype property, as prototype property is only available on functions.

    6. But myPoint has a __proto__ property like all other objects.

    7. The __proto__ property of myPoint is pointing to prototype property of Point.


    Thanks
     
    Last edited: Jul 23, 2018
    kayut, Jul 23, 2018 IP