This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9824|Reply: 0

[JavaScript] The difference between var a=new Object() and var a={} in js

[Copy link]
Posted on 2/3/2017 9:49:57 AM | | |

There is a difference in the initialization process, the former uses constructors to instantiate objects, the latter directly creates JSON objects, the latter is more convenient to initialize, and can be assigned values at the same time during initialization.
The objects created by both methods are the same in use, so it is recommended to use the latter when using it, which is more efficient.




Previous:chrome launch parameters
Next:.net/c# log4net database configuration write log [with source code]
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com