Home >Web Front-end >HTML Tutorial >How to convert string to boolean in JavaScript?
#You can try running the following command to learn how to convert a string to a boolean value in JavaScript.
Live Demonstration
<!DOCTYPE html> <html> <body> <p>Convert String to Boolean</p> <script> var myString = "Amit"; document.write("Boolean : " + Boolean(myString)); </script> </body> </html>
The above is the detailed content of How to convert string to boolean in JavaScript?. For more information, please follow other related articles on the PHP Chinese website!