

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I convert a string to boolean in JavaScript?
<p style="">Yes, it is possible to convert a string to Boolean.</p><h2>Example</h2><p style="">You can try to run the following code to achieve this −</p><p style=""><a href="http://tpcg.io/sbtGTu" rel="nofollow noopener noreferrer" target="_blank">Live Demo</a></p><pre class="prettyprint notranslate"><html> <head> <title>JavaScript Boolean</title> </head> <body> <script> var answer = true; document.write(answer); var result = (answer == 'true'); document.write("<br>"+result); </script> </body> </html></pre>
- Related Questions & Answers
- JavaScript Convert a string to boolean
- How to convert Boolean to String in JavaScript?
- How to convert String to Boolean in JavaScript?
- How to convert a boolean value to string value in JavaScript?
- How can I convert bytes to a Python string?
- How can I convert a Python tuple to string?
- How do I compare String and Boolean in JavaScript?
- How to convert a Boolean to Integer in JavaScript?
- How to convert string to boolean in PHP?
- How to convert a value into Boolean in JavaScript?
- How can I add a Boolean field to MySQL?
- How to convert Boolean to Number in JavaScript?
- How to convert Number to Boolean in JavaScript?
- How can I convert string to double in C/C++?
- Java Program to convert String to Boolean
Advertisements