January 2018
Beginner
658 pages
13h 10m
English
In our arguments definition, instead of just expecting an address argument we'll also expect a callback argument, and we can call this callback argument whenever we like. We'll call it in three places. We'll call it once inside of the if (error) block, instead of calling console.log we'll simply call the callback with the Unable to connect to Google servers. string. This string will be the error message we defined in geocodeAddress function in app.js.
In order to do this, all we need to do is change our console.log call to a callback call. We'll pass it as the first argument our error message. We can take the string exactly as it appeared in console.log, and move it into the arguments ...
Read now
Unlock full access