Skip to content

Instantly share code, notes, and snippets.

@avand
Created July 29, 2016 21:52
Show Gist options
  • Save avand/fffeb29570547a2d68c0177b6584048e to your computer and use it in GitHub Desktop.
Save avand/fffeb29570547a2d68c0177b6584048e to your computer and use it in GitHub Desktop.
// This would be so much easier to read and write...
var position = navigator.geolocation.getCurrentPosition();
console.log(position.coords.latitude);
// So why in the world do we have to write this?
navigator.geolocation.getCurrentPosition(function(position) {
console.log(position.coords.latitude);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment