MsAjax Lib-> Boolean.parse 函数
来源:互联网 发布:金域名人国际酒店电话 编辑:程序博客网 时间:2024/04/28 00:54
Boolean.parse 函数
将逻辑值的指定字符串表示形式转换为它的等效 Boolean Boolean 值。 本函数是静态函数,使用时无需实例化。
语法
var booleanVar = Boolean.parse("true");
参数
参数
定义
value
可以表达布尔值的字符串.
返回值
value所代表的布尔值.
异常
Error.argumentOutOfRange
(Debug) value 并非表达布尔值的字符串.
Error.argumentUndefined
(Debug) value 没定义.
Error.argumentNull Function
(Debug) value is null.
备注
使用 parse 通过一个字符串创建一个Boolean对象. value 参数必须为 "true" 或 "false" 之一. 字符串中可以包含空格. 如果字符串无法转换成布尔值则会抛出一个异常.
以下示例演示了如何使用 parse
JavaScript
var a = new Boolean(true);
if (a == true){
alert("a = true");
}else{
alert("a = false");
}
var b = Boolean.parse("true");
if (b == true){
alert("b = true");
}else{
alert("b = false");
}
请参见
- Boolean 类型扩展
- Boolean Object
- boolean Data Type (JScript)
- JScript Language Reference
- MsAjax Lib-> Boolean.parse 函数
- MsAjax Lib-> Array.parse 函数
- MsAjax Lib-> Boolean 类型扩展
- MsAjax Lib-> Array.enqueue 函数
- MsAjax Lib-> Array.dequeue 函数
- MsAjax Lib-> Array.forEach 函数
- MsAjax Lib-> Array.indexOf 函数
- MsAjax Lib-> Array.insert 函数
- MsAjax Lib-> Array.remove 函数
- MsAjax Lib-> Array.removeAt 函数
- MsAjax Lib-> Date.format 函数
- MsAjax Lib-> Date.localeFormat 函数
- MsAjax Lib-> Date.parseLocale 函数
- MsAjax Lib-> Date.parseInvariant 函数
- MsAjax Lib-> Date 类型扩展
- MsAjax Lib-> Error 类型扩展
- MsAjax Lib-> Number 类型扩展
- JSON.parse 函数 (JavaScript)
- java访问数据库
- 封装XMLHTTP
- Coding Rules
- MsAjax Lib-> Boolean 类型扩展
- 嘿嘿
- MsAjax Lib-> Boolean.parse 函数
- 禁止自动共享
- 十堰的经典小吃!!
- 强烈推荐!007大战黑衣人 胡戈新作!
- 新的一年。。。
- 总结:几种常见的查找算法
- Teach Yourself Programming in Ten Years
- spear fish,终于是看到图了
- 2月25