While making decisions we generally need some logic values. Logic values are generally true
and false
. In Javascript these values are called as Boolean
type. Boolean type variables holds logic values true and false. This type is simpler against string and number.
var open=true;
- open variable is boolean type and hold value true.
Convert To The String
Boolean values can be converted to the string like below.
var open=true; openString = open.toString();
- open holds true value
- toString will convert boolean true to string.