JavaScript toSource() 方法
定义和用法
toSource() 方法可把Boolean对象转换为JavaScript的源代码。
语法
booleanObject.toSource()
返回值
booleanObject 的JavaScript源代码表示。
说明
重要说明:在 Internet Explorer 中是不支持本方法的!
实例
<script type="text/javascript"> var b = new Boolean(true) document.write(b.toSource()) </script>
输出:
(new Boolean(true))