Write a note on promises in JavaScript.