Multiwingspan Home Page |
Multiwingspan Games |
Gnasher @ Multiwingspan |
Multiwingspan Calendar |
Multiwingspan Clock |
About Multiwingspan |
Visual Basic 6.0 Guide |
Visual Basic 6.0 Examples |
Turbo Pascal Guide |
SWI Prolog Guide |
Visual Basic 2005 Guide |
Structured Query Language |
HTML Design Tasks |
Introduction To HTML |
Introduction To CSS |
Introduction To Javascript |
AS/A2 Level Computing |
Operators are used to change or gather information about variables. This page will deal only with basic arithmetical operators. Other types of operator (eg logical - and, not etc.) will appear in the guide when used in the context of a specific script.
The following lines of code will add the variables a and b together and post the result in a message box.
var a = 5
var b = 10
var answer = a + b
alert("The answer is " + answer)
Bearing in mind that Javascript uses the standard computer characters for arithmetic (+ - * /), create a script which will add, subtract multiply and divide the two numbers specified. Change the values of a and b a few times to see the effect.
Return To Javascript Guide || Return To Homepage