This discussion is archived
8 Replies Latest reply: Nov 16, 2012 2:22 AM by gimbal2 RSS

how to write a if block for multiple conditions

user575089 Newbie
Currently Being Moderated
Can I keep 20 conditions in a if block ? code becomes lengthy

if(url.indexOf("saveDept")>0||(url.indexOf("saveRegion")>0) ......likewise 20 such conditions ){
//do something

}


Can I make my code shorter ?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points