Lesson 32 of 50

Building a Simple Calculator

Let’s create a calculator that adds, subtracts, multiplies, and divides two numbers using JavaScript.

function add(a,b){ return a+b; }
function subtract(a,b){ return a-b; }
function multiply(a,b){ return a*b; }
function divide(a,b){ return a/b; }
← Previous Next →