sort an array function
<p><strong>Picture</strong>
<a href="https://i.stack.imgur.com/ureQJ.jpg" rel="nofollow">My program</a></p>

<p>I'm making a program were you write in different sodas and rate them with points, I'm struggling to get it to sort the array after how many points the soda was given.</p>

<p><strong>Html</strong></p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;

    &lt;script src = "Assignment08.js"&gt;&lt;/script&gt;
    &lt;meta charset = "utf-8"&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;h1&gt;Innlevering 8&lt;/h1&gt;
    &lt;img src="julebrus.jpg" alt="Julebrus" style="width:304px;height:228px;"&gt;&lt;br&gt;

    Brustype: &lt;input id = "brustype" /&gt;&lt;br&gt;
    Poeng:    &lt;input id = "poeng" /&gt;&lt;br&gt;

    &lt;input type = "button" value = "Legg til brus" onclick = "leggTilBrus()" /&gt;

    &lt;b&gt;&lt;br&gt;Liste over brus:&lt;/b&gt;
    &lt;div id = "brusliste"&gt;&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p><strong>Javascript</strong></p>

<pre><code>var brusliste = [];

function Brus(sodatype, points) { // Brus = Soda (English)
    this.brustype = sodatype;
    this.poeng = points;

    this.sodainfo = function() {
        return this.brustype + " " + this.poeng;
    }
}

function leggTilBrus(){
    var sodatype = document.getElementById("brustype").value;
    var points = document.getElementById("poeng").value;

    var sodas = new Brus (sodatype, points);

    brusliste.push(sodas);
    visArray();
}

function sortFunction(tall1,tall2){
    return tall1.verdi-tall2.verdi;
}

function visArray() {
    document.getElementById("brusliste").innerHTML = "";

    for (var i = 0; i &lt; brusliste.length; i++){
        document.getElementById("brusliste").innerHTML += brusliste[i].sodainfo() + "&lt;br /&gt;";
    }
}

function init() {
    var b = new Brus(" ", " ");

    console.log(b);
    console.log(b.sodainfo());

    document.getElementById("brusliste").innerHTML =  b.brustype + " &lt;br /&gt;";

    brusliste.sort(sortFunction);
    //brusliste.sort(sorteringsFunksjon());
}

window.onload = init;
</code></pre>

<p>I need to write some more to get the post accepted x) anyway, any help will be appreciated. This thing is making my brain twist.</p>