标签:style blog class code c java
1 // create your Animal class here 2 function Animal(name,numLegs){ 3 this.name=name, 4 this.numLegs=numLegs 5 } 6 // create the sayName method for Animal 7 Animal.prototype.sayName=function(){ 8 console.log("Hi my name is"+" "+prototype.name); 9 } 10 11 // provided code to test above constructor and method 12 var penguin = new Animal("Captain Cook", 2); 13 penguin.sayName();
玩转codecademy (二),布布扣,bubuko.com
标签:style blog class code c java
原文地址:http://www.cnblogs.com/tyen0921/p/3732680.html