define promise in js code example
Example: making promises in js
getData()
.then(data => console.log(data))
.catch(error => console.log(error));
getData()
.then(data => console.log(data))
.catch(error => console.log(error));