Minggu, 27 Januari 2019

Boolean Method Inward Javascript

     The Boolean() constructor purpose takes i parameter to hold upwardly converted to a boolean value (i.e., truthful or false). Any valid JavaScript value that is non 0, −0, null, false, NaN, undefined, or an empty string(""), volition hold upwardly converted to true. Below, nosotros practice ii boolean object values. One true, i false.

""  => empty string returns fake value
"any val"  => string returns truthful value
3<4   => returns true
4<3  => returns false
null  => returns false

Syntax
      Boolean(condition);

Example
      alert(Boolean(3>4));


Example Program:- (Editor)


Editor is Loading...

Advertisement

Tags:
Boolean() method inwards allinworld99, Boolean() method volition provide truthful or fake value

Tidak ada komentar:

Posting Komentar