您好,欢迎访问一九零五行业门户网

在JavaScript中,如何将-Infinity转换为布尔值?

使用javascript中的boolean()方法将其转换为布尔值。您可以尝试运行以下代码来学习如何将-infinity转换为javascript中的布尔值。
示例实时演示
<!doctype html><html> <body> <p>convert -infinity to boolean</p> <script> var myval = -infinity; document.write("boolean: " + boolean(myval)); </script> </body></html>
以上就是在javascript中,如何将-infinity转换为布尔值?的详细内容。
其它类似信息

推荐信息