Thursday, 22 August 2013

switch-case with return and break

switch-case with return and break

Just out of curiosity, I often see situations like:
switch(something) {
case 'alice':
return something;
break;
}
Where the break seems to be completely unnecessary, is there any reason
for it to be there anyway?

No comments:

Post a Comment