Question: a) Evaluationassignmentssignmer .Part2clock_closures 2) Note thatthe folder containstwo library files namedibrary_clockjs andlibrary_stopwatchis. In the main JavaScriptile, notethatthevariables objects andfunctionsprovideall the functionalityfor the clock andstopwatchbut without
a) Evaluationassignmentssignmer .Part2clock_closures 2) Note thatthe folder containstwo library files namedibrary_clockjs andlibrary_stopwatchis. In the main JavaScriptile, notethatthevariables objects andfunctionsprovideall the functionalityfor the clock andstopwatchbut without using the libraries 3) In thelibrary_clockjs file, there'sa startfor a functionnamedcreate Clock. Note thatthis function hasparameterfor the spantagsthatdisplaythe clock in the page 4) In thelibrary_stopwatchs file, there'sa startfor a function namedcreate Stopwatch Note thatthis function hasparameterfor the spantagsthat displaythe stopwatchn the page 5) In the clockjs file, find the functionsthatrun the clock andmove themto the private state sectionof the library_clockis file. Then in the public methodssectionof the clock library file, codeandreturnan objectthat containsa methodnamedstar(). This methodshouldusethe privatestateto startthe clock Adjust the codeasneededo makethis work 6) In the clockjs file, find the variables objects andfunctionsthat run the stopwatchand move themto the privatestatesectionof the library_stopwatchis file. Then in the public methods section codeandreturnan objectthat containsmethodsnamedstar(), stop(), andrese(). Thesemethodsshouldusethe privatestateto start stop andresetthe stopwatchAdjust the codeasneededo makethis work. 7) Still in the clockjs file, rewrite the remainingcodeso the readyeventhandlercalls the functionsin the library files, passethemthe spantagstheyneed andusesthe returned objectsto startthe clock andattachthe stopwatcheventhandlers 8) In indexhtml, changethe textin the tag to yournameandstudentnumber
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
