Create an Object prototype called Hero which should have the following: Properties: name: a string to save
Fantastic news! We've Found the answer you've been seeking!
Question:
- Create an Object prototype called Hero which should have the following: Properties: name: a string to save his name dob: built-in Date object to save his date of birth powerlevel: a number that save his level powerlist:[] // an array of strings to save his powers Methods: todisplay(): returns a string with the Hero information in the format as: 'name' born on 'dob', his level is 'powerlevel', and his list of powers are 'powerlist'. Create 2 hero objects based on the given prototype Hero. Give appropriate property values for all hero objects. Create an array named heroes and add all the hero objects into the array. Using the array, output the information of your heroes to the console.
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date: