Best way to simplify this code, more efficient
- by Derek
My question is, is there a way to make this code more efficient or write it in a simple way? javascript by the way.
switch (tempvar1) {
case 1:
currentSlide = 'slide1';
showaslide('ppslide1');
break;
case 2:
currentSlide = 'slide2';
showaslide('ppslide2');
break;
case 3:
currentSlide = 'slide3';
showaslide('ppslide3');
break;
case 4:
currentSlide = 'slide4';
showaslide('ppslide4');
break;
case 5:
currentSlide = 'slide5';
showaslide('ppslide5');
break;
case 6:
currentSlide = 'slide6';
showaslide('ppslide6');
break;
// 20 total cases
}