The rules for coercion of string, number, and Boolean values in javascript are the following:

  • If you add a number and a string, the number is coerced to a string.
  • If you add a Boolean and a string, the Boolean is coerced to a string.
  • If you add a number and a Boolean, the Boolean is coerced to a number.
posted on 2013-06-17 14:20  @version  阅读(176)  评论(0)    收藏  举报