So, I want to know the difference between the following code blocks.I found that there's nothing different at all when I define some business logic module.
function People(){}
People.prototype = {role : 'user'}
function Male(){}
Male.prototype = new People(); // the difference
var m = new Male()
m.role // print user
m instanceof Male // print true
function People(){}
People.prototype = {role : 'user'}
function Male(){}
Male.prototype = People.prototype; // the difference
var m = new Male()
m.role // print user
m instanceof People // print true