博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
js类 的小例子
阅读量:4686 次
发布时间:2019-06-09

本文共 473 字,大约阅读时间需要 1 分钟。

 

 

class Flyer {    constructor(fname, speed) {      this.fname = fname;      this.speed = speed;    }    fly(){      console.log(this.fname,this.speed)    };  }  class Plane extends Flyer{    constructor(fname,speed,score) {      super(fname,speed);      this.score=score;    }    getScore(){      console.log(this.fname,this.speed,this.score);    };  }  var F16=new Plane('f16','100','50');  F16.fly();  F16.getScore();

 

转载于:https://www.cnblogs.com/web-fusheng/p/6764187.html

你可能感兴趣的文章
浅入深出Vue:工具准备之PostMan安装配置及Mock服务配置
查看>>
Tomcat6启用Gzip压缩功能
查看>>
Java字节码浅析(二)
查看>>
Vue选项卡
查看>>
http协议和四个层之间的关系
查看>>
(3)剑指Offer之数值的整数次方和调整数组元素顺序
查看>>
MongoDB学习笔记(索引)
查看>>
iOS - UIView
查看>>
VIM7.3设置(for Windows)
查看>>
[bzoj 1143]最长反链二分图最大匹配
查看>>
SpringBoot(一)
查看>>
Azure Powershell script检测登陆并部署ARM Template
查看>>
SSO
查看>>
【LeetCode刷题系列 - 003题】Longest Substring Without Repeating Characters
查看>>
常用git命令
查看>>
深入了解HTTP协议、HTTP协议原则
查看>>
软件开发者最重要的四大技能(转)
查看>>
redis集群【转】
查看>>
get、put、post、delete含义与区别
查看>>
JS中innerHTML,innerText,value区别
查看>>