function promiseExample(){
const promise = new Promise((resolve, reject) =>{
resolve('successfully!');
})
.then((resolve) => console.log(resolve))
.catch((reject) => console.log(reject));
return promise;
}
promiseExample()
I have a create simple code example for promises. you can easily check. how to resolve is working? and how to reject is working?