官术网_书友最值得收藏!

Time for action—giving our class instance some custom options

Let's give some custom options to our class by deploying the following:

  1. Go back to the source code of the HTML document you just created. Go to the var myDog = new Dog({ }); line.
  2. Pass property values to name, type, and age like so:
    var myDog = new Dog({
    name : 'Zensis',
    type : 'German Sheperd',
    age : 10
    });
    
  3. Open your HTML document in the web browser, and now, you should see something like this:
    Time for action—giving our class instance some custom options
主站蜘蛛池模板: 长岛县| 邹平县| 迭部县| 鄂伦春自治旗| 德格县| 湖口县| 洱源县| 化州市| 枝江市| 大连市| 芜湖市| 渭南市| 甘孜| 宜君县| 郧西县| 玉田县| 恭城| 甘肃省| 怀宁县| 米泉市| 临邑县| 九寨沟县| 离岛区| 安西县| 山东省| 瑞金市| 延安市| 东山县| 南康市| 渭南市| 汾西县| 四平市| 五河县| 静宁县| 盐池县| 广西| 成安县| 桃园市| 桂平市| 昂仁县| 武威市|