Why Symbol('test').toString()
works well, but I can't use '' + Symbol('test')
?
It will throw Error:
cannot convert a Symbol value to a string
Why does the implicit type conversion not work? Why is the code not equal to '' + Symbol('test').toString()
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…