Computer Science, asked by Riyana1001, 1 year ago

How do I compare String and Boolean in JavaScript?

Answers

Answered by Anonymous
1
I got the Json "false" from server. I respond as bool but it's Json so it's in browser type is Stringinstead of bool.
So if I run (!data) whenever I want to check "false" == false then they not worked.
So how can I parse bool from String in JavaScript then?
"true" == true and "false" == false. Then the code (!data) can check what it is [true and false]
Similar questions