Why did promises appear if asynchronous operations could be organized using generators? What was inconvenient about the callback approach?
Frontend
What are you currently working on?
In what cases will fetch execution go into catch? How to determine if the request was successful or not, and where does the HTTP status come from?
What do you know about the order of script connection and execution: regular script, async, and defer?
What is CORS and what are the options for solving cross-domain request issues?
What are the ways to bypass subscribers stored in a Set?
Type your array transformation function in TypeScript: define the necessary generic types for the element type of the source array and the result type.
Implement a function memo(fn, lifetime) that returns a new function and caches the result of the original function without arguments for a specified lifetime in milliseconds. It should cache only the last result, without keys and Map; a repeated call within the lifetime should return the cached result.
Implement a class in TypeScript following the 'Observer' pattern: it stores data in an object, allows subscribing and unsubscribing via subscribe/unsubscribe, and notifies subscribers upon data change through assignment. Include getter and setter; initial value should be an empty object.
Describe the stages of page rendering in the browser: DOM, CSSOM, render tree, layout/reflow, repaint, and compositing. Which properties are preferable to animate and why?
Implement an asynchronous task queue with concurrency limit: tasks are first added to the queue, then started by the loop method; no more than a specified number of tasks should run simultaneously. When all queued and running tasks are finished, notify about queue completion.
Implement a function that retries fetch requests several times upon failure. What should happen after exhausting attempts?
What happens in the browser after entering a URL?
How can a task queue be implemented using promises without flags and counters? What is a worker in the context of such a queue?