
上QQ阅读APP看书,第一时间看更新
Time for action—giving our class instance some custom options
Let's give some custom options to our class by deploying the following:
- Go back to the source code of the HTML document you just created. Go to the
var myDog = new Dog({ })
; line. - Pass property values to name, type, and age like so:
var myDog = new Dog({ name : 'Zensis', type : 'German Sheperd', age : 10 });
- Open your HTML document in the web browser, and now, you should see something like this: