Details of this Paper

Create a constructor function for a 'Cat' object




/**;* Create a constructor function for a `Cat` object.;* @constructor;* @param {string} name - The name of the cat as a string;* @param {string} color - The color of the cat;* The above values should be stored and be accessable via the name and color;* properties respectively. In addition, the following methods should be;* callable on a Cat object;* destroyFurniture({string} name, {number} cost) - adds a piece of destroyed;* furnature;* lastDestroyedFurniture() - returns a object with two key value pairs with;* keys 'name' and 'cost' and values corrisponding to the name and cash money;* value of the last item destroyed.;* totalDestroyed() - returns a {number} that is the total value of destroyed;* furniture.;* nthDestroyed({number} n) - Returns the nth destroyed furniture. 0 should;* return the first item destroyed, 1 the second and so on. It should return it;* as an object just as lasatDestroyedFurniture does.;*/


Paper#65034 | Written in 18-Jul-2015

Price : $32