Javascript Boolean Operator Question 4

Introduction

What is the output of the following code:


if (false || function(){console.log("A")}()) 
{
   console.log("1");   
}

if (true || function(){console.log("B")}()) 
{
  console.log("2");
}

if (true && function(){console.log("C")}()) 
{
  console.log("3");
}

if (false && function(){console.log("D")}()) 
{
  console.log("4");
}


A
2
C



PreviousNext

Related