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

View: 14692|Reply: 1

[JavaScript] js removes variable properties

[Copy link]
Posted on 6/8/2017 1:44:25 PM | | | |


Delete attributes

The only way to delete an attribute is to use the delete operator; Setting a property to undefined or null does not actually remove the property, but only removes the association between the property and the value.


The output above has bar undefined and foo null - only baz is actually removed, so it disappears from the output.




Previous:What is the difference between var a=function and function a?
Next:Baidu Maps API City Code (cityCode)
 Landlord| Posted on 8/10/2017 4:27:02 PM |




If you want to remove a js variable object, you must use delete, and assign the object you want to remove as empty, and it cannot be removed!
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