Monday, June 29, 2020

javascript boolean function String to boolean conversion

javascript boolean function String to boolean conversion
javascript boolean function String to boolean conversion

Learn about the javascript boolean function :-

Javascript Boolean can have two values (true and false) like any other programming languages.

Boolean function in javascript return the true value if the condition is true. For example : - 
Boolean(13 > 10)

Boolean toString() Method in javascript : - 

toString() function in boolean javascript gives a boolean value as a string.

Syntax : - 

boolean.toString()

javascript boolean toString() function return the value A String, either "true" or "false".

javascript Boolean valueOf() Method : - 

valueOf() function in boolean javascript gives the primitive value of a boolean.
var bool = false;
var y = bool.valueOf();

Syntax : - 

boolean.valueOf()

javascript boolean valueOf() function return the value A Boolean, either true or false

0 comments:

Post a Comment