Code: JavaScript
var array1=[1,33,4,56,7,99,9];
array1.sort(sortNumber);
document.write(array1);
function sortNumber(a,b)
{
    return a - b;
}