Which code segment should you use?

You are developing an HTML5 web application that displays customer mailing address
information.
The application loads addresses from a web service by using AJAX. The following code
defines a Customer object and loads address data.

You need to implement the loadAddress function.
Which code segment should you use?

You are developing an HTML5 web application that displays customer mailing address
information.
The application loads addresses from a web service by using AJAX. The following code
defines a Customer object and loads address data.

You need to implement the loadAddress function.
Which code segment should you use?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 5

Your email address will not be published. Required fields are marked *

15 − fourteen =


grt

grt

What is the difference between option c and option d?

Yep!

Yep!

The var is set 🙂

Kwanele Ntsimbi

Kwanele Ntsimbi

I also don’t see the difference between option C and D. Can anyone clarify a bit.

Vasyl

Vasyl

in d case this will be other object, it will be not customer object, it will be owner of $.get (not sure maybe window object)
so correct is C.

Yo

Yo

What Vasyl replied, plus…

In C, the code first instantiates an instance of Customer function (with parseAddress function inside). And then parseAddress can be used.