if (func()) javascript code example
Example 1: javascript if or
let A = 1;
let B = 0;
if (A == 1 || B == 1){
// some code here
}
Example 2: else if
if ( x > 10 )
{
cout << "x is greater than 10";
}
else
{
cout << "x is less than 10";
}
let A = 1;
let B = 0;
if (A == 1 || B == 1){
// some code here
}
if ( x > 10 )
{
cout << "x is greater than 10";
}
else
{
cout << "x is less than 10";
}