re: How I use JavaScript Promises VIEW POST

re: Hi, on your template, you seem to be enjoying the verbosity. If not, I recommend: function sample() { return new Promise((rs, rj) => { ...

Thanks for reading. The verbosity was intentional. The point was to show how to use Promises while writing functions as a beginner. Using arrow functions surely uses less lines of code and I use that in my actual projects. However explaining Promises to my juniors using arrow function was always difficult. I am familiar with async/await constructs. I still prefer Promises and use it as much as possible. But my colleagues who came from Java background they preferred async/await more 😀

code of conduct - report abuse