Which code segment should you use?

You are writing a code segment for a Virtual Earth 6.0 application. The code segment returns data for multiple locations to a client-side JavaScript function that makes the initial request.

The returned data contains the following properties for each location:

ID
Latitude
Longitude
Address

You need to format all locations and their properties in JavaScript Object Notation (JSON) format.

Which code segment should you use?

You are writing a code segment for a Virtual Earth 6.0 application. The code segment returns data for multiple locations to a client-side JavaScript function that makes the initial request.

The returned data contains the following properties for each location:

ID
Latitude
Longitude
Address

You need to format all locations and their properties in JavaScript Object Notation (JSON) format.

Which code segment should you use?

A.
var results = new Array();
results[0] = 123;
results[1] = 40.0;
results[2] = -74.0;
results[3] = “123 Main St.”;

B.
var results = new Array();
results[0] = new Array();
results[0][0] = 123;
results[0][1] = 40.0;
results[0][2] = -74.0;
results[0][3]= ” 123 Main St .”;

C.
var results = {
ID: 123,
Latitude: 40.0,
Longitude: -74.0,
Address: ” 123 Main St .”
};

D.
var results = {
0:{
ID: 123,
Latitude: 40.0,
Longitude: -74.0,
Address: ” 123 Main St ”
}
};



Leave a Reply 0

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