All you need to know about promises in JavaScript