Can i please get help on this?

function number_game(x, y) {
	var numArray = [];
	if (x > y) {
		for (let i = y + 1; i < x; i++) {
			if (i % 2 == 0) {
				numArray.push(i);
			}
		}
	} else {
		for (let i= x + 1; i < y; i++) {
			if ( i % 2 == 1) {
				numArray.push(i);
			}
		}
	}
	return numArray;
    }

this is my code response but it shows an error message on run; expected [ Array(9) ] to deeply equal [ Array(11) ]

here is my test challenge environment;

let assert = require(“chai”).assert;
describe(‘Challenge’, function() {
it(‘should return the right array’, function() {
assert.deepEqual(number_game(2,12), [3, 5, 7, 9, 11]);
assert.deepEqual(number_game(0,0), []);
});
});

and here is the question; iven two numbers X and Y, write a function that:
1 returns even numbers between X and Y, if X is greater than Y else it returns odd numbers between x and y

For instance, take the integers 10 and 2 . the function would return all the even numbers between 2 and 10.

Specification

numberGame ( x , y )

Return a list of odd or even number between two integers X and Y

Parameters

x: Number - The first integer provided

y: Number - The second integer provided

Return Value

Number - a list of odd or even numbers between x and y

If this is the specifications I fear the tests would not recognise your function name, as it asks you to use numberGame and you use number_game

Other than that, and the fact that you could try to reduce duplicated code, I don’t see anything weird, even if I haven’t any debugging tool available right now