http://www.w3schools.com/js/js_objects.asp
function person(firstname,lastname,age,eyecolor) { this.firstname=firstname; this.lastname=lastname; this.age=age; this.eyecolor=eyecolor; this.newlastname=newlastname; } function newlastname(new_lastname) { this.lastname=new_lastname; } var myFather=new person("John","Doe",50,"blue"); var myMother=new person("Sally","Rally",48,"green"); myFather.newlastname("Gu");
No comments:
Post a Comment