I have a simple callback function, created for my own learning use, which displays an alert once the first alert is displayed.
<script>
const sayMessage = (callbackFn) => {
alert("Hello there customer!");
callbackFn();
}
sayMessage(() => {
alert("You are about to enter Jims Gym supplies! Enjoy!");
})
</script>
Now I wish to do the same but using a promise. This is what I've done so far before I got stuck.
<script>
const promiseMessage = callbackFn =>{
return new Promise((resolve, reject) =>{
} )
}
</script>
I have looked at other similar questions posted, however none have helped me in understanding how to convert using the example I have created.
I have looked at this question How do I convert an existing callback API to promises? and it does not help me understand.