Referencing a variable in an object created using custom constructor
<p>Trying to get this to work in JS:</p>

<pre><code>var calculate = function(votesA, votesB, votesC) {

    var total = votesA + votesB + votesC;

    function Results(resultsA, resultsB, resultsC) {
        this.resultsA = resultsA;
        this.resultsB = resultsB;
        this.resultsC = resultsC;
    }

    var curResults = new Results(votesA, votesB, votesC);

    curResults.resultsA = (votesA / total) x 100;
    curResults.resultsB = (votesB / total) x 100;
    curResults.resultsC = (votesC / total) x 100;

    console.log(curResults.resultsA, curResults.resultsB, curResults.resultsC);
}

calculate(5,4,8);
calculate(5,6,8);
calculate(6,8,9);
</code></pre>

<p>Not sure why it isn't working, but I feel like it is something to do with how I am referencing the variables in curResults</p>
