Hi,

I have a query string parameter with value true or false. I need to convert
this value to corresponding boolean value for some conditional checking.

Currently, I'm using string comparision with == to evaluate.

var isPassiveAuthRequired = request.getParameter("passiveAuthRequired");

if('true' == isPassiveAuthRequired)   {
    //
}

This doesn't look a proper way. I tried Boolean(isPassiveAuthRequired), but
it returns false even for value 'true'.

Anybody knows a better way?

-- 
Thanks
Abimaran Kugathasan

Software Engineer | WSO2 Inc
Data & APIs Technologies Team
Mobile : +94 773922820

<http://stackoverflow.com/users/515034>
<http://lk.linkedin.com/in/abimaran>  <http://www.lkabimaran.blogspot.com/>
<https://github.com/abimaran>  <https://twitter.com/abimaran>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to