January 2020
Intermediate to advanced
470 pages
11h 13m
English
We can start tying ends together by revisiting a problem from a previous chapter. Remember when we had to calculate the average latitude and longitude for some geographic data that we looked at in the Extracting data from objects section of Chapter 5, Programming Declaratively – A Better Style? Basically, we started with some data such as the following and the problem was to calculate the average latitude and longitude of the given points:
const markers = [ {name: "AR", lat: -34.6, lon: -58.4}, {name: "BO", lat: -16.5, lon: -68.1}, {name: "BR", lat: -15.8, lon: -47.9}, {name: "CL", lat: -33.4, lon: -70.7}, {name: "CO", lat: 4.6, lon: -74.0}, {name: "EC", lat: -0.3, lon: -78.6}, {name: "PE", lat: -12.0, lon: -77.0},Read now
Unlock full access