当前位置:网站首页>2.9.5 ext JS object type processing and convenient methods
2.9.5 ext JS object type processing and convenient methods
2022-07-28 09:28:00 【oscar999】
JavaScript Of Object object type
Object Constructor creates an object wrapper for the given value . If the value is null Or undefined , It will create and return an empty object , otherwise , It will return an object of the type corresponding to the given value .
The structure is similar to :
var o = new Object(undefined);
var o = new Object(null);
create ( proto, [propertiesObject] ) : Object STATIC
Create a new object with the specified prototype and attributes .
For example look :
There is a graphic class Shape, There are two properties x,y They represent horizontal and vertical coordinates respectively :
function Shape() {
this.x = 0;
this.y = 0;
}
to Shape Add a prototype method - move(), Used to move the figure :
Shape.prototype.move = function(x, y) {
this.x += x;
this.y += y;
console.info("Shape moved.");
};
Define a rectangular function , call Shape.
function Rectangle() {
Shape.call(this);
}
Here we are , The preparations are over , Next call Object.create() .Rectangle.prototype
边栏推荐
- 2022 safety officer-b certificate examination simulated 100 questions and answers
- mysql 最大建议行数2000w,靠谱吗?
- ES6 let and Const
- Send a message to the background when closing the page
- Sentinel
- [one flower, one world - Professor Zheng Yi - the way of simplicity] interpretable neural network
- 信息学奥赛一本通 1617:转圈游戏 | 1875:【13NOIP提高组】转圈游戏 | 洛谷 P1965 [NOIP2013 提高组] 转圈游戏
- 376. 摆动序列【贪心、动态规划------】
- Modify virtual machine IP address
- 7 C控制语句:分支和跳转
猜你喜欢

5 operators, expressions, and statements

Introduction to official account

《PyTorch深度学习实践》第九课多分类问题(手写数字MNIST)

2022 examination question bank and simulation examination of crane driver (limited to bridge crane)
![【解决】ERROR in [eslint] ESLint is not a constructor](/img/58/2ce1243d0085462af3ba6d3da0817d.png)
【解决】ERROR in [eslint] ESLint is not a constructor
![[C language] detailed explanation sequence table (seqlist)](/img/60/c8cee6a6afe57247aba583291cc99b.png)
[C language] detailed explanation sequence table (seqlist)

Personal blog applet

DAPP safety summary and typical safety incident analysis

技术分享| 快对讲综合调度系统
![[592. Fraction addition and subtraction]](/img/3a/1a76a8acd60a6d45eebed612fd3971.png)
[592. Fraction addition and subtraction]
随机推荐
FPGA开发学习开源网站汇总
Title and answer of work permit for safety management personnel of hazardous chemical business units in 2022
Introduction to official account
leetcode 452. Minimum Number of Arrows to Burst Balloons 用最少数量的箭引爆气球(中等)
IDC脚本文件运行
What is it like to use gbase C API to execute stored procedures?
From development to testing: I started from scratch and worked for six years of automated testing
【C语言】详解顺序表(SeqList)
数据泄漏、删除事件频发,企业应如何构建安全防线?
mysql 最大建议行数2000w,靠谱吗?
2022年危险化学品经营单位安全管理人员上岗证题目及答案
1.5 merge\rebase\revert\stash\branch
OpenShift 4 - 使用 VerticalPodAutoscaler 优化应用资源 Request 和 Limit
《数据库系统内 幕》分布式系统
信息学奥赛一本通 1617:转圈游戏 | 1875:【13NOIP提高组】转圈游戏 | 洛谷 P1965 [NOIP2013 提高组] 转圈游戏
[附下载]推荐几款暴力破解和字典生成的工具
What is the difference between these two sets of code?
IT行业数据与应用关系的变迁
[solution] error in [eslint] eslint is not a constructor
The cooperation between starfish OS and metabell is just the beginning