Understanding promises in JavaScript | Ecency