In this post, you will be learning how to do Addition, Subtraction, Multiplication & Division using pure JavaScript. Let’s see a simple snippet first:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
//addition add = 5 + 2; document.write(add+"<br>"); //subtraction sub = 5 - 2; document.write(sub+"<br>"); //multiplication mul = 5 * 2; document.write(mul+"<br>"); //division div = 5 / 2; document.write(div+"<br>"); |