G0574's Archiver

弯月圆刀 发表于 2008-8-10 19:19

javascript 的boolean 类型

If a number is used where a boolean value is expected, the number is converted to TRue unless the number is 0 or NaN, which are converted to false. If a string is used where a boolean value is expected, it is converted to true except for the empty string, which is converted to false. null and the undefined value convert to false, and any non-null object, array, or function converts to true.

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.