```js
function isNumber(arr) {
    var result = [];
    if (arr.length > 1) {
        if (typeof arr[0] === 'number') {
            result.push(arr[0]);
            arr.splice(0, 1);
            isNumber(arr);
        } else {
            arr.splice(0, 1);
            isNumber(arr);
        }
    } else {
        console.log(result);
    }

}

isNumber([1,'2','3',2]);
```

I'm trying to create a function that goes through an array and if the first item is a number it will remove it and push it to an array called result. It then calls itself again until the array is empty. 

It currently returns an empty array and debugger shows that the result array keeps resetting back to an empty array. 

I understand why this happens but i'm trying to figure out how to work around it.