Add Some .click()'s - Part 4 problem!


#1

I am doing the Build A Calculator! JavaScript thing, and I am on "Add Some .click()'s - Part 4". I am stuck and I don't know what is wrong with my code. It is an error with this part,

if (operator === "+"){
            parseInt(number, 10);
            parseInt(newnumber, 10);
            var ANSWER = newnumber + number;
            ANSWER.toString(10);
            totaldiv.text(ANSWER);
            testNumLength(ANSWER);
            number = "";
            newnumber = "";
        } else if (operator === "-"){
            parseInt(number, 10);
            parseInt(newnumber, 10);
            var ANSWER = newnumber - number;
            ANSWER.toString(10);
            totaldiv.text(ANSWER);
            testNumLength(ANSWER);
            number = "";
            newnumber = "";
        } else if (operator === "/"){
            parseInt(number, 10);
            parseInt(newnumber, 10);
            var ANSWER = newnumber / number;
            ANSWER.toString(10);
            totaldiv.text(ANSWER);
            testNumLength(ANSWER);
            number = "";
            newnumber = "";
        } else if (operator === "*"){
            parseInt(number, 10);
            parseInt(newnumber, 10);
            var ANSWER = newnumber * number;
            ANSWER.toString(10);
            totaldiv.text(ANSWER);
            testNumLength(ANSWER);
            number = "";
            newnumber = "";
        }

And here is the whole thing, just in case it is needed,

$(document).ready(function(){
	var testNumLength = function(number) {
        if (number.length > 9) {
            totaldiv.text(number.substr(number.length-9,9));
            if (number.length > 15) {
                number = "";
                totaldiv.text("Err");
            }
        } 
    };
	var number = "";
    var newnumber = "";
    var operator = "";
    var totaldiv = $("#total");
    totaldiv.text("0");
    $("#numbers > a").not("#clear,#clearall").click(function(){
		number += $(this).text();
		totaldiv.text(number);
		testNumLength(number);
    });
    $("#operators > a").not("#equals").click(function(){
		operator = $(this).text();
		newnumber = number;
		number = "";
		totaldiv.text("0");
    });
    $("#clear,#clearall").click(function(){
		number = "";
		totaldiv.text("0");
		if ($(this).attr("id") === "clearall") {
			newnumber = "";
		}
    });
    $("#equals a").click(function(){
        if (operator === "+"){
            parseInt(number, 10);
            parseInt(newnumber, 10);
            var ANSWER = newnumber + number;
            ANSWER.toString(10);
            totaldiv.text(ANSWER);
            testNumLength(ANSWER);
            number = "";
            newnumber = "";
        } else if (operator === "-"){
            parseInt(number, 10);
            parseInt(newnumber, 10);
            var ANSWER = newnumber - number;
            ANSWER.toString(10);
            totaldiv.text(ANSWER);
            testNumLength(ANSWER);
            number = "";
            newnumber = "";
        } else if (operator === "/"){
            parseInt(number, 10);
            parseInt(newnumber, 10);
            var ANSWER = newnumber / number;
            ANSWER.toString(10);
            totaldiv.text(ANSWER);
            testNumLength(ANSWER);
            number = "";
            newnumber = "";
        } else if (operator === "*"){
            parseInt(number, 10);
            parseInt(newnumber, 10);
            var ANSWER = newnumber * number;
            ANSWER.toString(10);
            totaldiv.text(ANSWER);
            testNumLength(ANSWER);
            number = "";
            newnumber = "";
        }
    });
});