Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

I’m really stuck on this JavaScript assignment. The clock’s app stopwatch has to be enhanced.

Question

I’m really stuck on this JavaScript assignment. The clock’s app stopwatch has to be enhanced. I already added the

read-only property in the library_stopwatch.js file, but I’m not even sure if I added it correctly. Here are the steps below:

Note that there is a new library file named library_stopwatch_augment.js. In the HTML file, note that the script tag for this new library comes after the script tag for the stopwatch library. Also note that there’s a new span tag for the hours value of the stopwatch with a default value of “00”.

Change the library_stopwatch.js file so the module object has a read-only property that exposes the values of the private elapsed object. NOTE: Because elapsed is an object, if you return it directly, its properties can be changed even if the property that returns it is non-configurable. Thus, you’ll need to return an object that contains copies of the values in the elapsed object’s properties.

In the library_stopwatch_augment.js file, add code that augments the stopwatch module by adding a method named getElapsedTimeWithHours. Within this new method, get the object from the read-only property from the previous step, add an hours property to it, calculate the number of elapsed hours, adjust the number of elapsed minutes, and return the adjusted object.

Change the code in the clock.js file so the displayTick callback function uses the getElapsedTimeWithHours function from step 3 to display the hours in the s_hours span tag. Be sure to reset this span tag in the resetStopwatch callback function.

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"