Recursive setTimeot and/or setInterval. What's the difference?
Hello. Today we learned about recursive setTimeout and did not understand what is the specific difference. Below I will give examples, explain them if possible. Thanks in advance.
For example I have a function which executes in 1 second, and there's a setInterval with an interval of 500ms. If I understand correctly, then the setInterval will not look at the amount of time required to perform the function. It will still run the function every 500ms.
And still I read somewhere that if the function takes longer to execute than the specified interval, the setInterval does not wait for specified delay and will start immediately.
Which of these versions is correct?
About this method also is not entirely understood. Again an example: there is a function that runs for 1 second and interval c using setTimeout for example 500 MS. Whether to wait for the full implementation of the setTimeout function or the difference with setInterval that is guaranteed to function will be run every 500 MS?