Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use JavaScript! Convert other types to Bool

Shulou Source: shulou.com Published: 2022-06-01 04:39:29 10月05日 Update

This article is about how to use JavaScript! Convert other types to Bool content. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Use! Convert other types to bool type

Console.log (!! {}); / / trueconsole.log (! 0); / / falseconsole.log (! []); / / trueconsole.log (!! undefined); / / falseconst httpGet = (url, retry) = > {if (!! retry) {/ / timeout resend}} Thank you for reading! This is the end of this article on "how to use JavaScript! convert other types to Bool". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Type content more article good practical article see knowledge reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei OPPO Reno Xiaomi vpn MariaDB