Integers: | 7, -7 etc. | |
Octal: | 012 | = 1010 |
Hex: | 0xff | = 25510, useful for rgb colours |
Floating Point: | 314.0e-2 == 3.14 |
new Array( ) | creates a new one |
var a = new Array( ) | declares an array variable |
a[7] | 7th element |
a["fred"] | the fred element, equivalent to a.fred |
new someObject( ) | create a new one; can omit ( ) if no params |
var o = new someObject | |
o.f | access field etc. |
function MyObject(p1, p2, ...) // constructor { this.f1 = p1; this.f2 = p2; ... } MyObject.prototype.f3 = someExpression; MyObject.prototype.f4 = someFunction; // etc.// need `prototype' keyword as we are defining a class not an object instance
form
s etc.
Such data are tainted and values computed from them
are also tainted to prevent them from being
misused, e.g. for "marketing" purposes.