当前位置:网站首页>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
边栏推荐
- [English postgraduate entrance examination vocabulary training camp] day 15 - analyze, general, avoid, surveillance, compared
- 一款入门神器TensorFlowPlayground
- leetcode 452. Minimum Number of Arrows to Burst Balloons 用最少数量的箭引爆气球(中等)
- Oracle creates users with query permission only
- 2022年安全员-B证考试模拟100题及答案
- DAPP safety summary and typical safety incident analysis
- 如何在多线程环境下使用 GBase C API ?
- 对话MySQL之父:代码一次性完成才是优秀程序员
- Force deduction question (1) -- sum of two numbers
- 【英语考研词汇训练营】Day 15 —— analyst,general,avoid,surveillance,compared
猜你喜欢
![[one flower, one world - Professor Zheng Yi - the way of simplicity] interpretable neural network](/img/fd/8ae7c00061491ad78a0fd68b7c21b0.png)
[one flower, one world - Professor Zheng Yi - the way of simplicity] interpretable neural network

2022 high voltage electrician examination simulated 100 questions and simulated examination

Talk to the father of MySQL: code completion at one time is a good programmer

C#简单调用FMU ,进行仿真计算

Realize batch data enhancement | use of keras imagedatagenerator

【打包部署】
![[vscode] vscode usage](/img/0d/d6edbad047ecd7a092d4d7aa06e04d.png)
[vscode] vscode usage

Promise学习笔记

AMQ streams (1) of openshift 4 - multiple consumers receive data from partition

final关键字和枚举类型
随机推荐
What is the difference between these two sets of code?
ES6 let与const
Alibaba cloud server setup and pagoda panel connection
Oracle creates users with query permission only
正则表达式为十六进制数字?
【vscode】vscode使用
51 single chip microcomputer storage: EEPROM (I2C)
19c sysaux tablespace sqlobj$plan table is too large. How to clean it up
An entry artifact tensorflowplayground
js数组去重,id相同对某值相加合并
Dn-detr paper accuracy, and analyze its model structure & 2022 CVPR paper
Rgb-t tracking: [multimodal fusion] visible thermal UAV tracking: a large scale benchmark and new baseline
Solution and implementation of APP accelerating reading and displaying IPFs pictures
v-bind指令的详细介绍
ES6 变量的解构赋值
快速上手Flask(一) 认识框架Flask、项目结构、开发环境
MySQL 8.0.30 GA
[multithreading] the underlying principle of println method
Final keyword and enumeration type
LeetCode_ 406_ Rebuild the queue based on height