Product of All Odd Integers

Published by Helen Yu in

Create a function that returns the product of all odd integers in an array.

Examples

oddProduct([3, 4, 1, 1, 5]) ➞ 15

oddProduct([5, 5, 8, 2, 4, 32]) ➞ 25

oddProduct([1, 2, 1, 2, 1, 2, 1, 2]) ➞ 1

Notes

N/A

Watch a quick demo on how Edabit works.