3 ms·
- re: const assignments: you're correct. I did not compile this and the assignments should use let. - Show me where you have access to p1 outside of your closu
by olingern 8y ago
- re: const assignments: you're correct. I did not compile this and the assignments should use let.
- Show me where you have access to p1 outside of your closure.
The idea is / was -- you need access to both p1 and p2 for some comparison. The first `somePromise` would have been more accurately written `someInitalPromise`
The point is that try/catch + async & await removes a lot of cognitive overhead. Before async/await I rarely used try/catch -- so it's easy to get things done without it, but the combination of the two aforementioned has made codebases I work on much easier to maintain.