看下面一段脚本
  var i = 40 ;
  var b = Boolean(i);
  请问b的值是多少?

解决方案 »

  1.   

    The initial value of the Boolean object. The value is converted to a boolean value, if necessary. If value is omitted or is 0, null, false, or the empty string (""), the object has an initial value of false. All other values, including the string "false", create an object with an initial value of true. 所以结果 true
      

  2.   

    在 JavaScript 里,不为空 "" 的字符串、不为 0 的数字、不为 null 的对象、不为 undefined 的对象属性、布尔型 true,单独作为判断式里的一个表达式时 JavaScript 通通认定为真(true),反之则为假(false)。
      

  3.   

    在 JavaScript 里,
    不为空 "" 的字符串、不为 0 的数字、不为 null 的对象、不为 undefined 的对象属性、布尔型 true,单独作为判断式里的一个表达式时 JavaScript 通通认定为真(true),反之则为假(false)。楼上说的很清楚了