Thank you for the response! The compilation process goes through several stages, yes. This, however is more related to scope, hoisting, right and left hand side references.
First, thanks for the feedback — much appreciated!
About your question, you are absolutely correct — the timeout will increase. The thing is that all timeouts start simultaneously. Since a loop (especially a small one) runs really fast they will all be started basically at the same time. The delay between them…
Great article! Using loops in such a manner is a pretty graceful way to avoid call stack errors. Another but more hacky approach would be to wrap them in a
setTimeout with a timeout of
It took me quite some time to understand the concepts. It’s hard at first because there’s no analog — you need to first learn yourself how to think this way. I still revise them from time to time to make sure I don’t completely forget the topics!
I’m planning on writing more articles on data structures and algorithms in the future. :)
To be honest, I wouldn’t worry too much about program performance due to some additional variables or iteration. In modern browsers and even on mobile phones that shouldn’t be a bottleneck.
The things that slow down a program are related to http requests, db querying and managing the DOM. Modern libraries are way faster with…
Glad you liked it. Yes, I’m working on one for advanced querying followed by another for mutations (basically posting) to a service using GraphQL. I may even make a few videos cause it’s better to see it working :) I’ll make sure to update you!
Yes, this is my bad for not pointing it out. Fetch is usually provided by the browser, but in Node environment you don’t have access to that. You need to install node-fetch via npm and then you can use it as a normal module in your app. Run
npm install node-fetch and then
const fetch = require(‘node-fetch’) in the file that you need it. That should do the trick :)