July 2008
Beginner
356 pages
6h 8m
English
function F() {
function C() {
return this;
}
return C();
}
var o = new F(); The value of this refers to the global object or the object o?
function C(){
this.a = 1;
return false;
}
console.log(typeof new C());>>> c = [1, 2, [1, 2]];
>>> c.sort();
>>> c.join('--');
>>> console.log(c); String() constructor didn't exist. Create a constructor function MyString() that acts like String() as closely as possible. You're not allowed to use any built-in string methods or properties, and remember that String() doesn't exist. You can use this code to test your constructor:>>> var s = new MyString('hello'); >>> ...Read now
Unlock full access