Quiz
3) JavaScript - Advanced Topics (Checkpoints 18-21)
This quiz has a time limit, so it opens in the usual player.
Questions in this quiz (6)
1Which of these is an object constructor?
- Afunction Bunny(type) {
this.type = type;
} - Bvar Bunny = {type: ""chocolate""};
- CBunny.create();
- DObject.create(Bunny);
- Afunction Bunny(type) {
2function Star() { // function body };
var andromeda = new Star();
How might you visually depict the prototype chain of `andromeda`?- Aandromeda --> Star.prototype --> Object.prototype --> null
- Bandromeda --> Star --> Function.prototype --> Object.prototype --> null
- Candromeda --> Star.prototype -> Function.prototype --> Object.prototype --> null
- Dandromeda --> Star --> Object.prototype --> null
3var numbers = [4, 84, 9, 7, 33];
numbers.length; // returns 5
numbers.length = 4;
Given the code above, what will `numbers.length` return?- A4
- B5
- Cundefined
- Dnull
4x = ["y", "z"];
console.log(typeof x);
What prints to the console?- A"object"
- B"array"
- Cnull
- Dundefined
5var myString = "This is a string!";
myString.length;
True or false: In this example, `length` is an own property on `myString`.- ATrue
- BFalse
6var protoFrog = { // some properties };
var greenFrog = Object.create(protoFrog);
How might you visually depict the prototype chain of `greenFrog`?- AgreenFrog --> protoFrog --> Object.prototype --> null
- BgreenFrog --> protoFrog.prototype --> Object.prototype --> null
- CgreenFrog --> Object.prototype --> null
- Dnone of these
Information
- Description
- Quiz on 3) JavaScript - Advanced Topics (Checkpoints 18-21), created by Sanny Lin on 24/03/2016.
- Author
- Sanny Lin
- Language
- English
- Views
- 15
- Tags
- Rating
- 5.0 out of 5 · 1 rating Rate this quiz