Q:

How to make Javascript "isPrototypeOf" function return true?

I was trying this function to see if different objects have arelationship with each other, so I tried:
var o={name:'abc'};
var o2=o;
console.log(o.isPrototypeOf(o2));
console.log(o2.isPrototypeOf(o));

Well, it prints 2 falses. I felt weird that, "prototype" is a property/function of each function/object, so how does JS judge whether one object is the prototype of another?
I also tried:
var Person=function(){
    name='abc',
    age=30
};
var o1=new Person();
var o2=new Person();
console.log(o1.isPrototypeOf(o2));
console.log(o2.isPrototypeOf(o1));

Again, it prints 2 falses, while I expect 2 trues.

A:

For an o to be a prototype of o2 the o2 object needs to be constructed from a constructor whose prototype is o. In other words, o2 needs to properly inherit o.
It is not enough that a variable is assigned an object or two objects are similar. One object must inherit from another.
So in the classic sense, this must happen:
var o = {};
var OConstructor = function () {};
OConstructor.prototype = o;

var o2 = new OConstructor();

o.isPrototypeOf(o2); // true

In modern code you can also inherit using Object.create():
var o = {};

var o2 = Object.create(o); 

o.isPrototypeOf(o2); // true

