Get the App
SLTechnology News&Howtos  ›  Development  › 

How es6 creates an empty object

Shulou Source: shulou.com Published: 2022-06-01 04:10:11 09月22日 Update

This article is about how es6 creates an empty object. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Create an empty object

Sometimes we need to create a pure object that does not contain any prototype chains and so on. Generally, the most direct way to create an empty object is through the literal {}, but there is still a proto attribute in this object to point to Object.prototype and so on.

Let dict = Object.create (null); dict.__proto__ = = "undefined" Thank you for reading! This is the end of the article on "how to create an empty object in es6". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Object content more article good practical pure prototype literal attribute point article way see knowledge reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Apple Shulou Technology Linux macOS