READ Free Dumps For Microsoft- 70-480
Question ID 14918 | You are developing a shared library to format information. The library contains a method |
Option A |
* Here there is a basic example: // our constructor function Person(name, age){ this.name = name; this.age = age; }; // prototype assignment Person.prototype = (function(){ // we have a scope for private stuff // created once and not for every instance function toString(){ return this.name + " is " + this.age; }; // create the prototype and return them return { // never forget the constructor ... constructor:Person, // "magic" toString method toString:function(){ // call private toString method return toString.call(this); } }; })(); * Example: You can simulate private methods like this: function Restaurant() { } Restaurant.prototype = (function() { var private_stuff = function() { // Private code here }; return { constructor:Restaurant, use_restroom:function() { private_stuff(); } }; })(); var r = new Restaurant(); // This will work: r.use_restroom(); // This will cause an error: r.private_stuff(); |
Correct Answer | A |
Question ID 14919 | You are developing an HTML5 web application that displays stock information.
You need to implement the loadStock function. |
Option A | Option A |
Option B | Option B |
Option C | Option C |
Option D | Option D |
Correct Answer | A |