Quiz

  1. Can you talk more about instanceOf and how it determines something to be true or false?

    Sure. It starts at the object and goes up the prototype chain until it either finds a match (and returns true) or fails (and returns false).

  2. could you do a recap on what a prototype is? is there a concept same or similar in java?

    A prototype is an object that every instance is connected to by a link (implemented as the __proto__ property).

    The prototype is the object that stores all the methods, which means that all instances share the method code. So both ron's and harry's bank account object use exactly the same functions for deposit and withdraw

    We can also store properties in the prototype, which then all the instances share. We did this when we put the FDIC property in the prototype, so all the bank accounts became FDIC insured.

  3. all clear! / There are no topics I would like to talk about.

    Great!