PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You are developing an application that consumes an external web service. The web service returns the latest
stock rate. The application has two methods:
The getResults() method makes an AJAX web service request.
The ShowRate() method displays the stock rate from the web service response.The application has two JavaScript variables named newStockRate and stockRate to store the latest and
previous stock rates, respectively.
Users must be able to compare the old stock rate with the new stock rate.
You need to ensure that newStockRate and stockRate retain their values for comparison.
Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
Option A

B.
Option B

C.
Option C

D.
Option D

4 Comments on “Which code segment should you use?

  1. frank says:

    soory but I’nt see the variable newsStockRate in Question D or in C…
    where are definied, or is this a Typing error.??? I see only newStockRate!
    I thing the question D is correct. Because die variable is inside of the function.




    7



    1

Leave a Reply