当前位置:网站首页>JS -- reference type
JS -- reference type
2022-06-11 05:47:00 【Lao Liu selling vegetables at the corner of the street】
Object is an instance of a specific reference type
var person=new Object();====>Object It's a constructor
The two methods :
1
var person =new Object();
person.name="";
person.age=;
2
var person={name:;age:;}
function displayInfo(args) {
var output="";
if(typeof args.name=="string"){
output+="name:"+args.name+"\n";
}
if(typeof args.age=="number"){
output+="Age:"+args.age+"\n";
}
console.log(output);
}
displayInfo({
name:"solin",
age:22
});name: solin
age:22
边栏推荐
- Sword finger offer 50: the first character that appears only once
- 【深入kotlin】 - 初识 Flow
- Redis setup (sentinel mode)
- DISM命令使用小结
- 初步了解多任务学习
- Big meal count (time complexity) -- leetcode daily question
- [go deep into kotlin] - get to know flow for the first time
- Manually splicing dynamic JSON strings
- Minimize maximum
- NDK R21 compiles ffmpeg 4.2.2+x264 and converts video files using ffmpeg
猜你喜欢

Number of atoms (easy to understand)

深度学习分布式训练

NDK learning notes (12) native graphics API, using avilib to create an avi video player

View controller and navigation mode

智能门锁为什么会这么火,米家和智汀的智能门锁怎么样呢?
![[元数据]LinkedIn-DataHub](/img/6a/247ee77dfc219d26651e5d93b04c98.png)
[元数据]LinkedIn-DataHub

Do we really need conference headphones?

Use com youth. banner. Solution to the inflateexception reported by the banner plug-in

Multithreading tutorial (XXI) double checked locking problem

微信自定义组件---样式--插槽
随机推荐
Tencent X5 kernel initialization failed tbsreaderview not support by:***
Flask develops and implements the like comment module of the online question and answer system
Solution to slow connection speed of ojdbc under Linux system
MySQL circulates multiple values foreach, XML writing method
YOLOv5的Tricks | 【Trick8】图片采样策略——按数据集各类别权重采样
NDK learning notes (13) create an avi video player using avilib+opengl es 2.0
Exploration of kangaroo cloud data stack on spark SQL optimization based on CBO
DISM命令使用小结
Sword finger offer 50: the first character that appears only once
使用Batch设置IP地址
Set the IP address using batch
Multithreading tutorial (XXI) double checked locking problem
Install Oracle Database
NDK learning notes (V)
VSCode插件开发
Sword finger offer 04: find in 2D array
Sword finger offer 32: print binary tree from top to bottom
Get the full link address of the current project request URL
Maximum number of points on the line ----- hash table solution
修复Yum依赖冲突