January 2017
Beginner to intermediate
550 pages
10h 6m
English
Lets solve the following exercise:
function F() {
function C() {
return this;
}
return C();
}
var o = new F();
Does the value of this refer 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 the String() doesn't exist. You can use this code to test your constructor: ...Read now
Unlock full access