Javascript record bit by bit

1. Error object

 

Error is an object provided by Javascript to throw errors.

 

throw new Error('This is an error')

 

In IE, this error is displayed in the development and debugging tools:

 

 

If it is Chrome, it will display in the console:

 

 

Of course, this is an object that is not commonly used in actual business, and it is mainly used by some underlying frameworks.

 

2. Generate empty objects

 

In E5, the method of Object.create is added, and Object.create(null) can be used to generate an empty object.

 

If you use {} to generate an empty object, there is a lot of extra stuff in the object by default.

 

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326670918&siteId=291194637
Bit
BIT