Convert any Data Type to Boolean Using !!

by Mohan 2012-09-20 22:20:42


JAVAscript
Convert any Data Type to Boolean Using !!
This technique allows you to convert any data type, like string, number, or integer, to a Boolean using the !!. For example:
var myString = '23255';
typeof myString; //String

myString = !!myString;
typeof myString //Boolean



765
like
0
dislike
0
mail
flag

You must LOGIN to add comments