function Person(name){ this.name=name; this.age=0; this.sex='male'; this.married=0; this.say=function(){ return 'my name is '+this.name; } this.sayLove=function(lover){ return 'I love '+lover; } } var mike=new Person('Mike'); mike.age=18; mike.married=1; console.log(mike.name); console.log(mike.age); console.log(mike.sex); console.log(mike.married); console.log(mike.say()); console.log(mike.sayLove('Snow'));