- /**
- * 数据类型:
- * string number null undefined boolean symbol
- * */
- // Symbol 表示独一无二的值 一般用来解决命名冲突的问题
- // Symbol值不能与其他数据类型做运算
- // Symbol 不能使用for..in循环
- let s1 = Symbol();
- console.log(s1);
- console.log(typeof s1);
- let s2 = Symbol("张三");
- let s3 = Symbol("张三");
- console.log(s2 === s3);
|