当前位置:网站首页>js类的创建和constructor的构造函数的使用
js类的创建和constructor的构造函数的使用
2022-06-09 08:21:00 【Gjanuary】
class Car{
// 构造函数
constructor(carname){
this.carname = carname
}
// 行驶
move(){
console.log(this.carname+"我可以移动")
}
}
var redflag = new Car('红旗')
console.log(redflag.carname)
var fiveshine = new Car('五菱宏光')
console.log(fiveshine.carname)
fiveshine.move()
边栏推荐
- Puzzle (105) plane inversion
- mysql中if和ifnull
- 苹果胜诉 法官驳回iPhone安全欺诈集体诉讼
- 2022-2028 global TSCM equipment industry research and trend analysis report
- 自制编译器学习3:Flex和Bison简介
- Blow up the idea artifact in use recently
- Go questions / knowledge gathering - 2
- RMAN备份概念_关于RMAN控制文件和服务器参数文件的自动备份
- Leetcode basic programming: Search
- 【天线】【1】一些名词和简单概念的解释
猜你喜欢

ELK+Filebeat 部署安装

flyWay管理数据库

Secondary development of Nacos

Out object of JSP development details you should know (I)

刘勇智:一码通缺陷分析与架构设计方案丨声网开发者创业讲堂 Vol.02

C language review 12
![Nacos startup error [db load error]load jdbc properties error](/img/e0/e511da6cd6821ffb315d118a2feae9.png)
Nacos startup error [db load error]load jdbc properties error
Twitter's latest feature lets businesses preview upcoming products and remind customers to go shopping

Flyway management database

自制编译器学习1:Cb编译器的使用
随机推荐
At time_ What happens to TCP connections in wait status after SYN is received?
自制编译器学习2:编译的过程
刘勇智:一码通缺陷分析与架构设计方案丨声网开发者创业讲堂 Vol.02
IELTS复习1
Oracle partition table paging query SQL optimization
84.1% of the parents surveyed felt that there were more parents around who liked to coax their children with electronic products
Market Research - current situation and future development trend of global and Chinese cosmetic grade 1,2-hexanediol Market
Kibana:Kibana 入门 (一)
Market Research - current situation and future development trend of ethylene absorbent package market in the world and China
Liuyongzhi: one code communication defect analysis and architecture design scheme - sound network developer entrepreneurship lecture VOL.02
阿里云ack免密拉取企业版acr镜像
Flyway management database
【TeXstudio】【1】分式dfrac,tfrac Undefined control squence错误
系统运维系列 之greenplum vacuum清理删除数据命令
User name and password are encrypted in clear text during transmission cryptojs encryption (php/js encryption and decryption)
Oracle 分区表分页查询SQL优化
English语法_方式副词
国信证券开户安全吗
English语法_副词
NetCore框架WTM的分表分库实现