当前位置:网站首页>JS implementation chain call
JS implementation chain call
2022-07-07 10:38:00 【xinxin_ csdn】
Four operations can be realized by chain method
/* Simple chain call Class implementation */
class Person{
constructor(){
this.name = ''
}
setName(name) {
this.name = name
return this
}
getName() {
console.log('name:==',this.name)
}
}
const person = new Person()
person.setName('zx').getName()
/* Function implementation */
function Person() {
this.name = ''
}
Person.prototype = {
setName: function(name) {
this.name = name
return this
},
getName: function() {
console.log('name:==',this.name)
}
}
const person = new Person()
person.setName('zx').getName()边栏推荐
- 深入分析ERC-4907协议的主要内容,思考此协议对NFT市场流动性意义!
- Multithreaded asynchronous orchestration
- 对word2vec的一些浅层理解
- Multisim -- software related skills
- What are the test preparation materials and methods for soft exam information processing technicians?
- Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master
- Kotlin realizes wechat interface switching (fragment exercise)
- Mendeley--免费的文献管理工具,给论文自动插入参考文献
- 2022年7月10日“五心公益”活动通知+报名入口(二维码)
- P1031 [NOIP2002 提高组] 均分纸牌
猜你喜欢
![[recommendation system 02] deepfm, youtubednn, DSSM, MMOE](/img/d5/33765983e6b98235ca085f503a1272.png)
[recommendation system 02] deepfm, youtubednn, DSSM, MMOE

What are the contents of the intermediate soft test, the software designer test, and the test outline?

How much review time does it usually take to take the intermediate soft exam?

Is the soft test intermediate useful??

原型与原型链

求方程ax^2+bx+c=0的根(C语言)

P2788 math 1 - addition and subtraction

IIC基本知识

How to successfully pass the senior system architecture designer in the second half of the year?

无法打开内核设备“\\.\VMCIDev\VMX”: 操作成功完成。是否在安装 VMware Workstation 后重新引导? 模块“DevicePowerOn”启动失败。 未能启动虚拟机。
随机推荐
高级软考(网络规划设计师)该如何备考?
Talking about the return format in the log, encapsulation format handling, exception handling
CAS机制
MySQL insert data create trigger fill UUID field value
0x0fa23729 (vcruntime140d.dll) (in classes and objects - encapsulation.Exe) exception thrown (resolved)
Prototype and prototype chain
[daiy5] jz77 print binary tree in zigzag order
Experience sharing of software designers preparing for exams
CC2530 ZigBee iar8.10.1 environment construction
How embedded engineers improve work efficiency
1323: [example 6.5] activity selection
How to prepare for the advanced soft test (network planning designer)?
Study summary of postgraduate entrance examination in August
Common shortcut keys in IDA
[recommendation system 01] rechub
table宽度比tbody宽度大4px
What are the test preparation materials and methods for soft exam information processing technicians?
Schnuka: machine vision positioning technology machine vision positioning principle
Adb 实用命令(网络包、日志、调优相关)
IIC Basics