This is the code i have written to filter out Numeric values from an array, but it is returning the complete array. I am not able to find out the problem in my code. Please help me i am stuck...
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>html demo</title>
</head>
<body>
<script>
arr = ["apple", 5, "Mango", 6];
function filterNumeric(arrayName){
var i = 0;
var numericArray=[];
for (i; i <arrayName.length;i++){
if (typeof(arrayName[i] === 'number')) {
numericArray+=arrayName[i];
}
}
return numericArray;
}
var filter = filterNumeric(arr);
alert(filter);
</script>
</body>
</html>