We need to prove that in an array representation of heap, the leaves starts at index ⌊n/2⌋+1, ⌊n/2⌋+2 . . .and goes till n, n being the last leaf of the heap.
Consider the Person() constructor used to create the tom object. We copy the tom object to a new variable called newTom. Consequently, newTom is also a object, same as tom.
Functions can return objects. We have seen a bunch of tutorials on functions before. Here, we will see some expected and some unexpected behavior when function returns objects especially when that function is used as a constructor function
The instanceof operator can be used to check weather a object belongs to a particular constructor function or not. We have already discussed creation of objects from constructor functions.