re: Which would you prefer and why? VIEW POST

VIEW FULL DISCUSSION
 

As already pointed by Chris James, I would go like this:

function getResult(arg) {
  switch(arg) {
    case 'option1':
      return doStuff1();
    case 'option2':
      return doStuff2();
    case 'option3':
      return doStuff3();
  }
}
code of conduct - report abuse