Skip to content

Instantly share code, notes, and snippets.

@rintoandrews90
Created August 11, 2019 05:46
Show Gist options
  • Select an option

  • Save rintoandrews90/d6e56cf6c5a717ab7ca19d8276631987 to your computer and use it in GitHub Desktop.

Select an option

Save rintoandrews90/d6e56cf6c5a717ab7ca19d8276631987 to your computer and use it in GitHub Desktop.
Callback in node.js
const geoCode = (address,callback) => {
setTimeout(() => {
const data = {
latitude:0,
longitude:0
}
callback(data)
}, 2000);
}
geoCode("LosAngels", (data) => {
console.log(data)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment