lihongjie0209 / myblog

4 stars 0 forks source link

JavaScript: Symbol #246

Open lihongjie0209 opened 3 years ago

lihongjie0209 commented 3 years ago

In JavaScript, Symbol is a primitive value.

A value having the data type Symbol can be referred to as a "Symbol value". In a JavaScript runtime environment, a symbol value is created by invoking the function Symbol, which dynamically produces an anonymous, unique value. A symbol may be used as an object property.

Symbol can have an optional description, but for debugging purposes only.

总的来说就是一个带有描述信息的UUID