You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
562 B
24 lines
562 B
![]()
13 years ago
|
// built-in functions
|
||
|
|
||
|
foo = "foo bar stuff";
|
||
|
// 42-tiny-js change begin --->
|
||
|
// in JavaScript this function is called Math.random()
|
||
|
//r = Math.rand();
|
||
|
r = Math.random();
|
||
|
//<--- 42-tiny-js change end
|
||
|
|
||
|
parsed = Integer.parseInt("42");
|
||
|
|
||
|
aStr = "ABCD";
|
||
|
aChar = aStr.charAt(0);
|
||
|
|
||
|
obj1 = new Object();
|
||
|
obj1.food = "cake";
|
||
|
obj1.desert = "pie";
|
||
|
|
||
|
obj2 = obj1.clone();
|
||
|
obj2.food = "kittens";
|
||
|
|
||
|
result = foo.length==13 && foo.indexOf("bar")==4 && foo.substring(8,13)=="stuff" && parsed==42 &&
|
||
|
Integer.valueOf(aChar)==65 && obj1.food=="cake" && obj2.desert=="pie";
|