当前位置:网站首页>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()边栏推荐
- 555电路详解
- P1223 queuing for water /1319: [example 6.1] queuing for water
- Is the soft test intermediate useful??
- 软考中级有用吗??
- I plan to take part in security work. How about information security engineers and how to prepare for the soft exam?
- 【实战】霸榜各大医学分割挑战赛的Transformer架构--nnFormer
- How much review time does it usually take to take the intermediate soft exam?
- Schnuka: machine vision positioning technology machine vision positioning principle
- JS实现链式调用
- 使用U2-Net深层网络实现——证件照生成程序
猜你喜欢
![P1223 queuing for water /1319: [example 6.1] queuing for water](/img/09/29f19b32f0a3c82ddb3c30d5d0b16e.png)
P1223 queuing for water /1319: [example 6.1] queuing for water

leetcode-304:二维区域和检索 - 矩阵不可变

简单易修改的弹框组件

ThreadLocal is not enough

多线程-异步编排

Application of OpenGL gllightfv function and related knowledge of light source

打算参加安全方面工作,信息安全工程师怎么样,软考考试需要怎么准备?
![[daiy5] jz77 print binary tree in zigzag order](/img/ba/b2dfbf121798757c7b9fba4811221b.png)
[daiy5] jz77 print binary tree in zigzag order
![1321: [example 6.3] deletion problem (noip1994)](/img/bd/b605ec7b901079a9ebaca446fad7fb.png)
1321: [example 6.3] deletion problem (noip1994)

P1223 排队接水/1319:【例6.1】排队接水
随机推荐
【作业】2022.7.6 写一个自己的cal函数
HDU-2196 树形DP学习笔记
使用 load_decathlon_datalist (MONAI)快速加载JSON数据
[email protected] can help us get the log object quickly
字符串格式化
Deeply analyze the main contents of erc-4907 agreement and think about the significance of this agreement to NFT market liquidity!
Using U2 net deep network to realize -- certificate photo generation program
Summary of router development knowledge
Leetcode-304: two dimensional area and retrieval - matrix immutable
无法打开内核设备“\\.\VMCIDev\VMX”: 操作成功完成。是否在安装 VMware Workstation 后重新引导? 模块“DevicePowerOn”启动失败。 未能启动虚拟机。
[牛客网刷题 Day6] JZ27 二叉树的镜像
Kotlin realizes wechat interface switching (fragment exercise)
Application of OpenGL gllightfv function and related knowledge of light source
[STM32] solution to the problem that SWD cannot recognize devices after STM32 burning program
About hzero resource error (groovy.lang.missingpropertyexception: no such property: weight for class)
When do you usually get grades in the soft exam? Online pedaling?
[recommendation system 01] rechub
软考中级,软件设计师考试那些内容,考试大纲什么的?
ThreadLocal会用可不够
TypeScript 接口继承