You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// We will see 'decoding data' only once, as our function is run only once.
178
+
// We will see 'decoding data' logged only once,
179
+
// as our function is run only once.
173
180
}
174
181
175
182
main();
@@ -188,12 +195,11 @@ function main() {
188
195
// Do nothing
189
196
});
190
197
191
-
// We will see 'decoding data' only once, as our function is run only once.
198
+
// We will see 'decoding data' logged only once,
199
+
// as our function is run only once.
192
200
}
193
201
194
202
main();
195
203
```
196
204
197
205
As we learned earlier, listening to a promise using `.then()` neither affects nor starts that promise — it has no side-effect on that promise. And `await` behaves the same — it also has no side-effect on the source promise. It simply waits for its eventual value.
0 commit comments