returns "true", "false" as string instead of boolean
See original GitHub issueSince true
and false
are expected to be boolean values, negating and/or testing explicitly failes.
XML
<a show="false"/>
to JSON
{
"a": {
"_attributes": {
"show": "false"
}
}
}
Testing
if (!a._attributes.show) // this is will not end well
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to return string instead of boolean in javascript
There are some errors like you use (return true/false) instead of string value return. Except in if (S.length === 0) { console.log(result ...
Read more >Boolean.prototype.toString() - JavaScript - MDN Web Docs
For Boolean values, the toString method returns a string representation of the boolean value, which is either "true" or "false" .
Read more >Return a String instead of true/false - Power Platform Community
If you want to change the boolean value from true to ''yes'' and false to ''no'' (change from Boolean to string).
Read more >Java.lang.Boolean.toString() Method - Tutorialspoint
The java.lang.Boolean.toString(boolean b) returns a String object representing the specified boolean. If the specified boolean is true, then the string "true ...
Read more >JavaScript String to Boolean – How to Parse a Boolean in JS
Note: When you convert a string of "false" , you'd expect it to return a boolean value of false . But this will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@nashwaan Thank you very much! ❤️ Especially for the fast response time.
@winniehell thanks for your contribution.
nativeTypeAttributes
is now published inv1.6.5
.