 <p>You need to convert the values to Number, there are plenty of ways to do it:</p> <pre><code>var test1 = +window.prompt("Number1"); // unary plus operator var test2 = Number(window.prompt("Number2")); // Number constructor var test3 = parseInt(window.prompt("Number3"), 10); // an integer? parseInt var test4 = parseFloat(window.prompt("Number4")); // parseFloat </code></pre>