Skip to content

Variables And Operations

Fabian Morón Zirfas edited this page Jun 13, 2025 · 3 revisions

Variables should have meaningful names as in the examples below ;)

Variables

var a = "Hello World!";//Strings

var b = 5.5;//Numbers

var c = true;//Boolean

Operations

/*
    You can use operators to transform variables
    + - * / % = . ++ -- += -= *= /= 
    like this 
    */

var a = 10000;
var b = 356;
var res = b / a;
alert(res);

alert((5 % 4) + " modulo?"); // modulo

var calc = (a / 100) * 13;
alert(calc);
var str = "Hi there buddy!" + "\n" + "The result is: ";
alert(str + calc);
calc += 5;
calc++;
calc--;
calc = calc + 5;
alert(calc);

Home

Clone this wiki locally