methods of promise object code example
Example: promise nodejs
async function myFunction(){
return new Promise((resolve,reject)=>{
try {
// your code
resolve(/* your data */);
} catch (error) {
reject(error);
}
});
}