malaikuangren

What is the purpose or drive to build thing like (xxx),How can it achieve the original goal of design?

2013年3月22日

What's the best way to define a class in javascript

摘要: // Define a class like thisfunction Person(name, gender){ // Add object properties like this this.name = name; this.gender = gender;}// Add methods like this. All Person objects will be able to invoke thisPerson.prototype.speak = function(){ alert("Howdy, my name is" + this.name);}// Insta 阅读全文

posted @ 2013-03-22 15:20 malaikuangren 阅读(147) 评论(0) 推荐(0) 编辑