This page tests AWeb's ECMAScript 3 (JavaScript 1.5) core language features. These tests focus on the JavaScript language itself, not browser-specific extensions. Rows under Graceful Failure use intentional faults to verify stable error handling.
Variable x = Expected: 1 | Actual:
a = 5, b = 3
Sum (a + b) = Expected: 8 | Actual:
Product (a * b) = Expected: 15 | Actual:
Message (two-step): Expected: Hello World | Actual:
Message (chained): Expected: Hello World | Actual:
Direct concat test: Expected: Hello World | Actual:
Direct concat with vars: Expected: Hello World | Actual:
addNumbers(10, 20) = Expected: 30 | Actual:
Array: [1, 2, 3, 4, 5] (created with new Array)
First element (arr[0]) = Expected: 1 | Actual:
Array length = Expected: 5 | Actual:
Array type check: Expected: object | Actual:
testValue = 8
Is testValue even? Expected: yes | Actual:
val1 = 5, val2 = 3
val1 > val2: Expected: true | Actual:
val1 < val2: Expected: false | Actual:
val1 == val2: Expected: false | Actual:
val1 != val2: Expected: true | Actual:
Loop result (0 to 2): Expected: 0 1 2 | Actual:
For loop result (0 to 2): Expected: 0 1 2 | Actual:
obj.name = Expected: Test | Actual:
obj.value = Expected: 42 | Actual:
Original: "Hello World"
toUpperCase(): Expected: HELLO WORLD | Actual:
toLowerCase(): Expected: hello world | Actual:
length: Expected: 11 | Actual:
charAt(0): Expected: H | Actual:
Math.PI: Expected: 3.141592653589793 | Actual:
Math.sqrt(16): Expected: 4 | Actual:
Math.max(5, 10): Expected: 10 | Actual:
Math.min(5, 10): Expected: 5 | Actual:
Math.abs(-5): Expected: 5 | Actual:
Current Date object created
getYear(): Expected: current year (e.g., 2026) | Actual:
getMonth(): Expected: current month (0-11) | Actual:
getDate(): Expected: current day of month (1-31) | Actual:
addAndMultiply(2, 3, 4) = (2+3)*4 = Expected: 20 | Actual:
Array: [1, 2, 3, 4, 5]
First element: Expected: 1 | Actual:
Last element: Expected: 5 | Actual:
Array length: Expected: 5 | Actual:
a = true, b = false
a && b: Expected: false | Actual:
a && a: Expected: true | Actual:
a || b: Expected: true | Actual:
b || b: Expected: false | Actual:
!a: Expected: false | Actual:
!b: Expected: true | Actual:
Direct typeof tests (simpler): - PASS
typeof 42: Expected: number | Actual:
typeof "test": Expected: string | Actual:
typeof true: Expected: boolean | Actual:
typeof undefined: Expected: undefined | Actual:
typeof with variables: - PASS
typeof num (42): Expected: number | Actual:
typeof str ("hello"): Expected: string | Actual:
typeof bool (true): Expected: boolean | Actual:
typeof obj (new Object()): Expected: object | Actual:
typeof arr (new Array()): Expected: object | Actual:
typeof func (function): Expected: function | Actual:
String: "Hello World"
indexOf("o"): Expected: 4 | Actual:
lastIndexOf("o"): Expected: 7 | Actual:
indexOf("x") (not found): Expected: -1 | Actual:
String: "Hello World"
substring(0, 5): Expected: Hello | Actual:
substring(6): Expected: World | Actual:
Array: ["a", "b", "c"]
join(", "): Expected: a, b, c | Actual:
After reverse(), join(", "): Expected: c, b, a | Actual:
Math.pow(2, 8): Expected: 256 | Actual:
Math.round(3.7): Expected: 4 | Actual:
Math.round(3.2): Expected: 3 | Actual:
Math.floor(3.7): Expected: 3 | Actual:
Math.ceil(3.2): Expected: 4 | Actual:
Math.random(): Expected: [number between 0 and 1] | Actual:
Current Date object
getHours(): Expected: [current hour 0-23] | Actual:
getMinutes(): Expected: [current minute 0-59] | Actual:
getSeconds(): Expected: [current second 0-59] | Actual:
getDay(): Expected: [current day 0-6, 0=Sunday] | Actual:
getTime(): Expected: [milliseconds since epoch] | Actual:
a = 10, b = 5, c = 2
a + b * c (precedence): Expected: 20 | Actual:
(a + b) * c: Expected: 30 | Actual:
a - b / c (precedence): Expected: 7.5 | Actual:
(a - b) / c: Expected: 2.5 | Actual:
Object with multiple properties
person.name: Expected: John | Actual:
person.age: Expected: 30 | Actual:
person.city: Expected: New York | Actual:
calculate(3, 4) = (3+4) + (3*4) = Expected: 19 | Actual:
score = 85
Grade: Expected: B | Actual:
Array: [1, 2, 3]
After arr[1] = 99, arr[1] = Expected: 99 | Actual:
Array length: Expected: 5 | Actual:
10 % 3: Expected: 1 | Actual:
15 % 5: Expected: 0 | Actual:
7 % 2: Expected: 1 | Actual:
a = 5, b = 3
a & b (bitwise AND): Expected: 1 | Actual:
a | b (bitwise OR): Expected: 7 | Actual:
a ^ b (bitwise XOR): Expected: 6 | Actual:
num = 8
num << 2 (left shift): Expected: 32 | Actual:
num >> 1 (right shift): Expected: 4 | Actual:
Initial x = 10
After x += 5: Expected: 15 | Actual:
After x *= 2 (from 10): Expected: 20 | Actual:
After x -= 3 (from 10): Expected: 7 | Actual:
a = 5, ++a: Expected: 6 | Actual:
a++, then a: Expected: 7 | Actual:
b = 5, --b: Expected: 4 | Actual:
b--, then b: Expected: 3 | Actual:
String: "ABC"
charCodeAt(0): Expected: 65 | Actual:
charCodeAt(1): Expected: 66 | Actual:
charCodeAt(2): Expected: 67 | Actual:
Array: [3, 1, 4, 1, 5]
After sort(): Expected: 1, 1, 3, 4, 5 | Actual:
Nested object structure
person.address.city: Expected: New York | Actual:
person.address.zip: Expected: 10001 | Actual:
square = function(x) { return x * x; }
square(5): Expected: 25 | Actual:
max(10, 7): Expected: 10 | Actual:
global = 10, function has local = 20
testScope() returns: Expected: 30 | Actual:
Math.PI: Expected: 3.141592653589793 | Actual:
Math.E: Expected: 2.718281828459045 | Actual:
new Date().toString(): Expected: [date string representation] | Actual:
"Hello".length: Expected: 5 | Actual:
"World".length: Expected: 5 | Actual:
"".length: Expected: 0 | Actual:
Array: [1, 2, 3]
After push(4), length: Expected: 4 | Actual:
pop() returned: Expected: 4 | Actual:
After pop(), length: Expected: 3 | Actual:
Array: [2, 3, 4]
After unshift(1), length: Expected: 4 | Actual:
shift() returned: Expected: 1 | Actual:
After shift(), length: Expected: [number] | Actual:
Math.round(3.7): Expected: [trigonometric/logarithmic result] | Actual:
Math.round(3.2): Expected: [trigonometric/logarithmic result] | Actual:
Math.floor(3.7): Expected: [trigonometric/logarithmic result] | Actual:
Math.ceil(3.2): Expected: [trigonometric/logarithmic result] | Actual:
Math.pow(2, 3): Expected: [trigonometric/logarithmic result] | Actual:
Math.pow(5, 2): Expected: [trigonometric/logarithmic result] | Actual:
Math.random(): (should be 0-1)
true && true: Expected: [boolean] | Actual:
true && false: Expected: [boolean] | Actual:
true || false: Expected: [boolean] | Actual:
false || false: Expected: [boolean] | Actual:
5 && 3: Expected: [see test code above] | Actual:
0 || 7: Expected: [see test code above] | Actual:
(5 > 3) ? "yes" : "no": Expected: [see test code above] | Actual:
(2 > 5) ? "yes" : "no": Expected: [see test code above] | Actual:
(10 > 5) ? 100 : 50: Expected: [see test code above] | Actual:
parseInt("42"): Expected: [parsed number] | Actual:
parseInt("3.14"): Expected: [parsed number] | Actual:
parseFloat("3.14"): Expected: [parsed number] | Actual:
parseFloat("42"): Expected: [parsed number] | Actual:
str1 = "Hello", str2 = "World"
str1.concat(" ", str2): Expected: [array or string] | Actual:
"A".concat("B", "C"): Expected: [array or string] | Actual:
Array: [1, 2, 3, 4, 5]
slice(1, 3): Expected: [array or string] | Actual:
slice(2): Expected: [array or string] | Actual:
do-while loop: sum from 0 to 4
Result: Expected: inner caught, outer caught | Actual:
sum(1, 2, 3, 4, 5) using arguments: Expected: [see test code above] | Actual:
factorial(5): Expected: [see test code above] | Actual:
new Date().getTime(): (milliseconds since epoch)
obj.prop1 before delete: Expected: [see test code above] | Actual:
obj.prop1 after delete: Expected: [see test code above] | Actual:
obj.prop2 still exists: Expected: [see test code above] | Actual:
Object properties: name, age, city
Properties found: Expected: [see test code above] | Actual:
Loop breaks when i > 5
Sum (0 to 5): Expected: [see test code above] | Actual:
Continue skips even numbers
Sum of odd numbers (1,3,5,7,9): Expected: [see test code above] | Actual:
Original: "Hello World!"
escaped: Expected: [encoded/decoded string] | Actual:
unescaped: Expected: [encoded/decoded string] | Actual:
isNaN("not a number"): Expected: [boolean] | Actual:
isNaN(42): Expected: [boolean] | Actual:
isNaN(NaN): Expected: [boolean] | Actual:
Array 1: [1, 2, 3]
Array 2: [4, 5, 6]
concat result: Expected: [array or string] | Actual:
String: "apple,banana,cherry"
split(",") result: Expected: [array of strings] | Actual:
obj.x = 10, obj.y = 20
with (obj) { result = x + y; }
Result: Expected: inner caught, outer caught | Actual:
x = 42
void x: Expected: [see test code above] | Actual:
typeof void x: Expected: [see test code above] | Actual:
a = 1, b = 2, c = 3
(a++, b++, c++) returns: Expected: 3 | Actual:
After comma: a + b + c = Expected: 9 | Actual:
new Object().toString(): Expected: [string] | Actual:
42.toString(): Expected: [string] | Actual:
3.14.toString(): Expected: [string] | Actual:
true.toString(): Expected: [boolean] | Actual:
false.toString(): Expected: [boolean] | Actual:
obj.value = 100
Direct access obj.value: Expected: [see test code above] | Actual:
obj.getValue() using this: Expected: [see test code above] | Actual:
Array: [1, 2, 3]
arr.toString(): Expected: [string] | Actual:
nullVar = null
typeof null: Expected: [see test code above] | Actual:
typeof undefined: Expected: undefined | Actual:
nullVar == null: Expected: [see test code above] | Actual:
undefinedVar == undefined: Expected: [see test code above] | Actual:
function testFunc(a, b, c) { ... }
testFunc.length: Expected: [number] | Actual:
new RegExp("test"): Expected: [see test code above] | Actual:
new RegExp("hello", "i"): Expected: [see test code above] | Actual:
/pattern/: Expected: [see test code above] | Actual:
/test/gi: Expected: [see test code above] | Actual:
Pattern: /hello/
test("hello world"): Expected: [boolean or array] | Actual:
test("goodbye"): Expected: [boolean or array] | Actual:
Pattern: /hello/i (case-insensitive)
test("HELLO"): Expected: [boolean or array] | Actual:
Pattern: /(\d+)/
exec("abc123def")[0]: Expected: [boolean or array] | Actual:
exec("no numbers"): Expected: [boolean or array] | Actual:
Pattern: /test/gi
source: Expected: [see test code above] | Actual:
global: Expected: [see test code above] | Actual:
ignoreCase: Expected: [case result] | Actual:
multiline: Expected: [see test code above] | Actual:
Pattern: /pattern/m
multiline: Expected: [see test code above] | Actual:
Pattern: /test/g (global)
After first test(), lastIndex: Expected: [boolean or array] | Actual:
After second test(), lastIndex: Expected: [boolean or array] | Actual:
After setting lastIndex = 0: Expected: [see test code above] | Actual:
String: "Hello World"
match(/o/)[0]: Expected: [match result] | Actual:
match(/x/): Expected: [match result] | Actual:
match(/o/g): Expected: [match result] | Actual:
String: "Hello World"
search(/World/): Expected: [match result] | Actual:
search(/x/): Expected: [match result] | Actual:
search(/o/i): Expected: [match result] | Actual:
String: "Hello World"
replace(/World/, "Universe"): Expected: [match result] | Actual:
String: "test test test"
replace(/test/g, "TEST"): Expected: [match result] | Actual:
String: "abc123def456"
replace(/\d+/, "NUM"): Expected: abcNUMdef456 | Actual:
String: "apple,banana,cherry"
split(/,/): Expected: [array of strings] | Actual:
String: "one two three"
split(/\s+/): Expected: one, two, three | Actual:
Pattern: new RegExp("test")
test("test string"): Expected: [boolean or array] | Actual:
After compile("hello", "i"):
test("HELLO"): Expected: [boolean or array] | Actual:
source: Expected: [see test code above] | Actual:
Pattern: /(\d+)-(\d+)/
exec("123-456")[0]: Expected: [match result] | Actual:
exec("123-456")[1]: Expected: [boolean or array] | Actual:
exec("123-456")[2]: Expected: [boolean or array] | Actual:
Pattern: /test/gi
toString(): Expected: [string] | Actual:
Pattern: new RegExp("hello", "m")
toString(): Expected: [string] | Actual:
try { var x = 10; var y = x + 5; } catch (e) { }
Result: Expected: [try-catch result] | Actual:
try { throw "error message"; } catch (e) { }
Result: Expected: [thrown value] | Actual:
try-catch-finally block
try result: Expected: [try-catch result] | Actual:
finally executed: Expected: [try-catch result] | Actual:
try { throw "error"; } catch (e) { } finally { }
catch result: Expected: [thrown value] | Actual:
finally executed: Expected: [thrown value] | Actual:
Nested try-catch blocks
Result: Expected: inner caught, outer caught | Actual:
arr instanceof Array: Expected: true | Actual:
obj instanceof Object: Expected: true | Actual:
str instanceof String: Expected: true | Actual:
arr instanceof Object: Expected: true | Actual:
obj instanceof Array: Expected: false | Actual:
obj.name = "John", obj.age = 30
"name" in obj: Expected: [boolean] | Actual:
"age" in obj: Expected: [boolean] | Actual:
"city" in obj: Expected: [boolean] | Actual:
"0" in arr: Expected: [see test code above] | Actual:
"length" in arr: Expected: [number] | Actual:
throw "test error": Expected: [Error object or string] | Actual:
throw 42: Expected: [thrown value] | Actual:
new Error("test error")
Error name: Expected: [Error object or string] | Actual:
Error message: Expected: [Error object or string] | Actual:
Error toString(): Expected: [string] | Actual:
new TypeError("type error")
TypeError name: Expected: [Error object or string] | Actual:
TypeError message: Expected: [Error object or string] | Actual:
new RangeError("range error")
RangeError name: Expected: [Error object or string] | Actual:
RangeError message: Expected: [Error object or string] | Actual:
new SyntaxError("syntax error")
SyntaxError name: Expected: [Error object or string] | Actual:
SyntaxError message: Expected: [Error object or string] | Actual:
new ReferenceError("reference error")
ReferenceError name: Expected: [Error object or string] | Actual:
ReferenceError message: Expected: [Error object or string] | Actual:
new URIError("URI error")
URIError name: Expected: [Error object or string] | Actual:
URIError message: Expected: [Error object or string] | Actual:
new EvalError("eval error")
EvalError name: Expected: [Error object or string] | Actual:
EvalError message: Expected: [Error object or string] | Actual:
5 === 5: Expected: [boolean] | Actual:
5 === "5": Expected: [boolean] | Actual:
null === null: Expected: [boolean] | Actual:
null === undefined: Expected: [boolean] | Actual:
true === true: Expected: [boolean] | Actual:
true === 1: Expected: [boolean] | Actual:
5 !== 5: Expected: [boolean] | Actual:
5 !== "5": Expected: [boolean] | Actual:
null !== null: Expected: [boolean] | Actual:
null !== undefined: Expected: [boolean] | Actual:
switch (2) { case 1: ... case 2: ... case 3: ... default: ... }
Result: Expected: [case result] | Actual:
switch (99) with default case
Result: Expected: [case result] | Actual:
switch (1) with fall-through
Result: Expected: [case result] | Actual:
Labeled loops with break
Result: Expected: [loop result] | Actual:
break outer from inner loop
Result: Expected: [loop result] | Actual:
continue outer from inner loop
Result: Expected: [loop result] | Actual:
3.14159.toFixed(2): Expected: [formatted number string] | Actual:
3.14159.toFixed(0): Expected: [formatted number string] | Actual:
3.14159.toFixed(5): Expected: [formatted number string] | Actual:
42.toFixed(2): Expected: [formatted number string] | Actual:
Number.MAX_VALUE: Expected: [number constant] | Actual:
Number.MIN_VALUE: Expected: [number constant] | Actual:
Number.NaN: Expected: [number constant] | Actual:
Number.POSITIVE_INFINITY: Expected: [number constant] | Actual:
Number.NEGATIVE_INFINITY: Expected: [number constant] | Actual:
Array: [1, 2, 3, 4, 5]
After splice(1, 2): Expected: 1, 4, 5 | Actual:
Removed: Expected: 2, 3 | Actual:
Array: ["a", "b", "c", "d"]
After splice(1, 1, "x", "y"): Expected: a, x, y, c, d | Actual:
String.fromCharCode(65, 66, 67): Expected: [string from char codes] | Actual:
String.fromCharCode(72, 101, 108, 108, 111): Expected: [string from char codes] | Actual:
"apple".localeCompare("banana"): Expected: [number: -1, 0, or 1] | Actual:
"banana".localeCompare("apple"): Expected: [number: -1, 0, or 1] | Actual:
"apple".localeCompare("apple"): Expected: [number: -1, 0, or 1] | Actual:
function greet(name) { return "Hello, " + name; }
greet.call(obj, "John"): Expected: [return value] | Actual:
greet.call(null, "Jane"): Expected: [return value] | Actual:
function sum(a, b, c) { return a + b + c; }
sum.apply(null, [1, 2, 3]): Expected: [return value] | Actual:
sum.apply(null, [10, 20, 30]): Expected: [return value] | Actual:
obj.value = 100, function getValue() { return this.value; }
getValue.call(obj): Expected: [return value] | Actual:
new Boolean(true): Expected: true | Actual:
new Boolean(false): Expected: false | Actual:
new Boolean(1): Expected: true | Actual:
new Boolean(0): Expected: false | Actual:
new Number(42).valueOf(): Expected: [primitive value] | Actual:
new Number(3.14).valueOf(): Expected: [primitive value] | Actual:
new Number(42).toString(): Expected: [string] | Actual:
new String("Hello").valueOf(): Expected: [primitive value] | Actual:
new String(42).valueOf(): Expected: [primitive value] | Actual:
new String("Hello").length: Expected: [number] | Actual:
obj.name = "John"
obj.hasOwnProperty("name"): Expected: [boolean] | Actual:
obj.hasOwnProperty("toString"): Expected: [string] | Actual:
obj.hasOwnProperty("nonexistent"): Expected: [boolean] | Actual:
obj.name = "John"
obj.propertyIsEnumerable("name"): Expected: [boolean] | Actual:
obj.propertyIsEnumerable("toString"): Expected: [string] | Actual:
Parent.prototype.isPrototypeOf(child): Expected: [boolean] | Actual:
Object.prototype.isPrototypeOf(child): Expected: [boolean] | Actual:
Math.sin(0): Expected: [trigonometric/logarithmic result] | Actual:
Math.cos(0): Expected: [trigonometric/logarithmic result] | Actual:
Math.tan(0): Expected: [trigonometric/logarithmic result] | Actual:
Math.asin(0): Expected: [trigonometric/logarithmic result] | Actual:
Math.acos(1): Expected: [trigonometric/logarithmic result] | Actual:
Math.atan(0): Expected: [trigonometric/logarithmic result] | Actual:
Math.atan2(0, 1): Expected: [trigonometric/logarithmic result] | Actual:
Math.log(Math.E): Expected: [trigonometric/logarithmic result] | Actual:
Math.log(1): Expected: [trigonometric/logarithmic result] | Actual:
Math.exp(1): Expected: [trigonometric/logarithmic result] | Actual:
Math.exp(0): Expected: [trigonometric/logarithmic result] | Actual:
Math.LN2: Expected: [trigonometric/logarithmic result] | Actual:
Math.LN10: Expected: [trigonometric/logarithmic result] | Actual:
Math.LOG2E: Expected: [trigonometric/logarithmic result] | Actual:
Math.LOG10E: Expected: [trigonometric/logarithmic result] | Actual:
Math.SQRT1_2: Expected: [trigonometric/logarithmic result] | Actual:
Math.SQRT2: Expected: [trigonometric/logarithmic result] | Actual:
Date setters
After setYear(2001), getYear(): Expected: [updated date value] | Actual:
After setMonth(5), getMonth(): Expected: [updated date value] | Actual:
After setDate(15), getDate(): Expected: [number or date string] | Actual:
Date.parse("2000-01-01"): Expected: [number or date string] | Actual:
Type: Expected: [see test code above] | Actual:
isFinite(42): Expected: [boolean] | Actual:
isFinite(Infinity): Expected: [boolean] | Actual:
isFinite(-Infinity): Expected: [boolean] | Actual:
isFinite(NaN): Expected: [boolean] | Actual:
isFinite("42"): Expected: [boolean] | Actual:
parseInt("10", 10): Expected: [parsed number] | Actual:
parseInt("10", 2): Expected: [parsed number] | Actual:
parseInt("10", 8): Expected: [parsed number] | Actual:
parseInt("10", 16): Expected: [parsed number] | Actual:
parseInt("FF", 16): Expected: [parsed number] | Actual:
String: "Hello World"
slice(0, 5): Expected: [array or string] | Actual:
slice(6): Expected: [array or string] | Actual:
slice(-5): Expected: [array or string] | Actual:
slice(0, -6): Expected: [array or string] | Actual:
String: "Hello World"
substr(0, 5): Expected: [see test code above] | Actual:
substr(6): Expected: [see test code above] | Actual:
substr(6, 3): Expected: [see test code above] | Actual:
These rows document deliberate faults. Many are EXPECTED to report failure or to skip code; the browser must remain stable and later sections of this page must still run.
The next SCRIPT block contains a syntax error. If this explanation text is visible after loading, the parser did not abort the entire document.
ES131 recovery line: visible means markup after broken SCRIPT still rendered.
neg_es132_ok = Expected: 1 | Actual:
Error name: Expected: SyntaxError (or similar) | Actual:
Error name: Expected: ReferenceError | Actual:
Error name: Expected: TypeError | Actual:
This page tests ECMAScript 3 core language features only. For browser extension tests (window, document, forms, events), see javascript_test.html.
Last Updated: 2026 - AWeb 3 ECMAScript 3 Core Language Test