For loop to simplify code

For loop to simplify code

I'm trying to work out how I can write this code more efficiently. I'm thinking it should be possible to 'wrap' it in a 'for loop', but I can figure out how to assign each iteration ( i = 9 to i = 12) to the 'multiplier' and then to get the related code to apply to the relevant iteration?

  1. for(i = 9; i < 13; i++)

  1. if(multiplier == 9) {
  2.       middleArray.pop();
  3.       middleArray.push('0');               
  4. }

  5. if(multiplier == 10) {
  6.       for(i = 1; i < 3; i++) {
  7.       middleArray.pop();
  8. }
  9.       middleArray.push('1', '2');               
  10. }

  11. if(multiplier == 11) {
  12.       for(i = 1; i < 4; i++) {
  13.       middleArray.pop();
  14. }
  15.       middleArray.push('1', '2', '3');               
  16. }

  17. if(multiplier == 12) {
  18.       for(i = 1; i < 5; i++) {
  19.       middleArray.pop();
  20. }
  21.       middleArray.push('0', '2', '3', '4');               
  22. }