What is a promise in JavaScript? write an example code