let num = 10;
//call back function
const promis = new Promise(function (resolve, reject) {
if (num > 5) {
//this resolve method will send data to resoleveData variable
resolve(" Problem resolved successfully")
}
else {
//this reject method will send data to rejectData variable
reject("sorry problem couldn't solve")
}
})
//resoleveData variable
promis.then(function (resolveData) {
console.log(resolveData)
//rejectData variable
}).catch(function (rejectData) {
console.log(rejectData)
})