- Construct a
forloop that sorts the array
[2, 3, 13, 18, -5, 38, -10, 11, 0, 104]into two new arrays:
- Define an empty
evensarray to hold the even numbers and an
oddsarray for the odd numbers.
- In the loop, determine if each number is even or odd, then put that number into
odds, as appropriate.
- Print the arrays to confirm the results. Print
evensfirst. Example: `console.log(evens);
This prints Odd and Even arrays but also print empty elements in array. I am stuck at the point to print the clear array. Does anyone has anything to add/help? Thank you!