Magento
M70-301 · Question #85
Your project, which uses prototype.js, contains the JavaScript class Photoviewer (see EXAMPLE, below). Which one of the following code samples will create a class called AdvancedPhotoViewer that…
The correct answer is B. AdvancedPhotoViewer.prototype = Object.extend (new PhotoViewer (). See the full explanation below for the reasoning.
Question
Your project, which uses prototype.js, contains the JavaScript class Photoviewer (see EXAMPLE, below). Which one of the following code samples will create a class called AdvancedPhotoViewer that extends Photoviewe r? EXAMPLE:
var PhotoViewer = Class.create();
Options
- Avar AdvancedPhotoViewer = new PhotoViewer()
- BAdvancedPhotoViewer.prototype = Object.extend (new PhotoViewer ()
- Cvar AdvancedPhotoViewer = Class.extend (PhotoViewer)
- DAdvancedPhotoViewer = PhotoViewer.extend ()
How the community answered
(51 responses)- A14% (7)
- B73% (37)
- C10% (5)
- D4% (2)
Community Discussion
No community discussion yet for this question.