Created
August 11, 2019 05:46
-
-
Save rintoandrews90/d6e56cf6c5a717ab7ca19d8276631987 to your computer and use it in GitHub Desktop.
Callback in node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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