JS 对象和数组的创建使用new和不使用new有什么区别呢?
烟雨江南
烟雨江南 2017-03-13 09:16:28
0
2
1091

比如:

var a = Array(); 和 var aa = new Array();
var b = Object(); 和 var bb  = new Object();


烟雨江南
烟雨江南

reply all(2)
数据分析师

What is the difference between using new and not using new when creating JS objects and arrays? -PHP Chinese website Q&A-What is the difference between using new and not using new when creating JS objects and arrays? -PHP Chinese website Q&A

Let’s take a look and learn.

迷茫

使用new的话如果函数没有return会返回一个对象。不使用new如果函数没有return会返回undefined。

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!