Question: I want to sort an array containing numerical values. I know the original logic but it is not working for me. However I want to stop sorting for the similar numerical values in an array.

Answer: 
```
var numbers = [40, 100, 1, 5, 25, 10];
numbers.sort(function(a, b){return a-b});

```
By default the sort method sorts elements alphabetically. but for sort numerically just add a new method which handles numeric sorts **sortNumber**, (shown below) 

```
    function sortNumber(a,b) {
        return a - b;
    }

    var numArray = [140000, 104, 99];
    numArray.sort(sortNumber);
    alert(numArray.join(","));

```