Data typeBefore introducing symbol, let's briefly describe the JavaScript data type:JavaScript has 6 data types, namely:
string literal type
Number numeric type
Object type
Boolean Boolean value type
Null empty value
For example, the following code: {code...} while ($ strue) {} cannot be displayed? Where can I use true ~~ For beginners, please take care of O (∩ _ ∩) O ~ Happy New Year ~ My own understanding is :! If 'false' is true, 1. The value is not equal to 2
For example, the following code:
$str4="php-class,mysql-class,div-css,0,dreamweaver";$s=strtok($str4,',');while($s!==false){ echo $s.""; $s=strtok(',');}
while ($s ===true) {} Why can't it be displayed?True where to use it ~ ~Beginners Please
What is Symbol?
Symbols is not an icon, nor does it mean that you can use a small picture in your code:
Nor does it refer to the grammar of other things. So, what exactly is Symbol to?Seven types of data
When JavaScript was normalized in 1997,
JavaScript Symbol type
Depending on the specification, the object property key can only be string or symbol type, not number, Boolean, only string and symbol two types.We typically compare attribute string, and now look at the advantages that the
ES5 object property names are strings, which can easily cause property names to conflict. For example, if you use an object provided by another person but want to add a new method to the object (mixin mode), the name of the new method may conflict
SymbolOverview as symbol instance of property name: Eliminates the traversal of the Magic string property name Symbol.for (), Symbol.keyfor () instance: the Symbol value built into the module's Singleton mode
Overview
ES5 object property names are
Symbol resolves property name conflicts for objects
Remember some of the data types we know.
String number Object undefined Null
Boolean
Now, one more type is symbol.
Let A=symbol ()
Console.log (a)//symbol ()
Console.log (typeof a)//symbol
The code
Discussion on the technology of symbol mc1000 ----- the code of the display. Reg light-on under Platform
**************************************** **************************************** *********************; *** This file is provided to configure
Javascript has two ways of determining whether two values are equal.
Equality symbol
The equality symbol consists of two equals: = =Javascript is a weakly typed language. This means that the equality symbol will cast the type in order to compare
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.