Question: I need help with this javascript question. It was one question but I split it into steps to make it easier. Also if you can
I need help with this javascript question. It was one question but I split it into steps to make it easier. Also if you can add comments explaining what's going on in the code, that would be much appreciated. Template is below.

Code a JavaScript constructor function called VideoType that will handle the following set of properties: title (string) category (string) cast (string array) price (number) numRents (number) vidRevenue (number) Whenever a new object is created, the first 4 properties will need to be passed into the constructor function as parameters and the last 2 (numRents and vidRevenue) should be initialized to 0 and 0.0 respectively. In addition to these object level properties, create a prototype level numeric variable called totRevenue which is attached to the Video Type constructor function. As such, this single variable will be visible to all objects created using the constructor function. See the Methods2.html example for more information. Next, create a JavaScript method called procRental which takes no parameters. The purpose of this method is to process a video rental transaction which includes: a. Incrementing the total number of rentals for the video (numRents) b. Incrementing the total rental revenues for the video (vidRevenue) c. Incrementing the total rental revenues for all videos (totRevenue) Create an onload" event handler which will call a JavaScript function named StartMeUp and within StartMeUp create an empty array called videos. Do all the rest of the steps from within StartMeUp Using the sample data listed below and your VideoType" constructor function, create 3 new video objects as the first 3 elements in the array (videos [0], videos [1], and videos [2]). See the Methods 1.html" example for more information on how to handle the cas array. Now, add a two-level nested for loop to the StartMeUp function to test your application. The outer loop should cycle through 5 times and the inner loop will use a call to the procRental method to simulate the processing of a rental for each of your videos. The inner loop must cycle as many times as there are video objects. Finally, use document.write to print out all the properties for all the video objects in the videos array as well as a total Rental $ amount for each video and a grand total $ for all the videos rented. See the sample output below for the required formatted output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
