Q:

Multiplying N positive odd numbers

I'm trying to get the product of N positive odd numbers 
function multOdd(n) {
  var mult = 1;
  var counter=[];

  for (var i = 1; i <= 2*n-1; i += 2){
    counter.push(i);
  }

  console.log(counter);
  return mult=mult*counter[i];
}                

console.log(multOdd(10));

I pushed the numbers into an array and attempted to get the product from them but I can't get it to work.

A:

When you return mult=mult*counter[i] you're only returning the multipication once. It should return mult = 1 * counter[lastElement+2] which will be wrong. In your case, the last element of counter is 19, before exiting for loop i value is i= 19 + 2 = 21. You're returning mult = 1 * 21 = 21.
You can instead return the multipication value by for loop with no need for an array:
function multOdd(n) {
  var mult = 1;

  for (var i = 1; i <= 2*n-1; i += 2){
    mult = mult * i;
  }

  return mult;
}    

