阅读背景:

Implicitly: Strings <--> Numbers

来源:互联网 

According to ES5 spec section 11.6.1, the + algorithm (when an object value is an operand) will concatenate if either operand is either already a string, or if the following steps produce a string representation. So, when + receives an object (including array) for either operand, it first calls the ToPrimitive abstract operation (section 9.1) on the value, which then calls the [[DefaultValue]] algorithm (section 8.12.8) with a context hint of number.According to ES5 spec section 11.6.1, the + algo




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: