Given an array with the mixed element types, return a new array with only number-type elements. The input numbers can be both float (decimal number) and integer.
Sample Code:
function seekNum(arr) {
// Enter your logic here...
}
Examples:
Input: [1,2,3.1,'4',['number']]
Output: [1,2,3.1]
Explanation: Number-type elements are 1,2, and 3.1
Input: ['1',{id:'2'},'3.1']
Output: []
Explanation: None of the elements are numbers.