Question: This is for JavaScript only. Create a script called battle.js. In this script code the following: A. Class and Constructor Creation (25 Points) Player Class

This is for JavaScript only.

This is for JavaScript only. Create a script called battle.js. In thisscript code the following: A. Class and Constructor Creation (25 Points) PlayerClass Create a constructor function or ES6 class for a Player object.The Player object should have the following properties Name: Holds the name

Create a script called battle.js. In this script code the following: A. Class and Constructor Creation (25 Points) Player Class Create a constructor function or ES6 class for a Player object. The Player object should have the following properties Name: Holds the name of the player. Pass into the constructor. Health: Defaults to 10, do not pass into the constructor, just define and set to 10 in the constructor Strength: Defaults to 2 Weapons: An array of weapons objects. Should be passed into the constructor Weapon Class Create a constructor function or ES6 class for a Weapon object. It should have the following properties: Name: Holds the name of the weapon. Passed into the constructor. Damage: Defaults to a random number between 1 and 5, do not pass into the constructor, just define in the constructor and set it

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!