Which one is good to use when there is a large number of branching flow in Node.JS Program.

switch

switch(n)
{
case 1:
  execute code block 1
  break;
case 2:
  execute code block 2
  break;
default:
  code to be executed if n is different from case 1 and 2
}

OR
if-else

if (condition1)
  {
    execute code block 1
  }
else if(condition2)
  {
    execute code block 2
  } 
else
  {
     code to be executed if n is different from condition1 and condition2
  } 
Edit
Report