Sobes.tech

Why do we store timeoutId? What will happen if the Promise resolves before the timeout, and then the setTimeout with reject is triggered?

Middle
238

How to get the width of a DOM element and track its changes? Can you attach a resize event to a DOM element using addEventListener?

Middle
219

How do cookies differ from localStorage? What is the maximum size of cookies and localStorage? How does their lifetime differ?

Middle
219

How does git merge differ from git rebase? What are the advantages and disadvantages of each approach?

Middle
176

Как можно решить задачу withTimeout альтернативным способом — через Promise.race? Что такое Promise.race, чем отличается от Promise.all?

Middle
172

Write a custom React hook useScreenWidth(targetWidth) that returns the current screen width (screenWidth) and a flag isMobile (true if the current width is less than targetWidth). The hook should update when the window size changes.

Middle
167

What is prop drilling? How many levels of nesting are considered acceptable?

Middle
161

Create a function that rejects the returned promise, passing the string "timeout_error" as the error, if it does not resolve within the specified timeout, or behaves normally as the original. @param {Promise} promise the original promise @param {Number} timeoutMilliseconds the timeout duration in milliseconds @return {Promise} a promise with the desired behavior function withTimeout(promise, timeout) { return new Promise((res, rej) => { const timeoutId = setTimeout(() => { rej("timeout_error") }) }) }

Middle
159

What other React hooks do you know? Tell about useRef, useReducer, useCallback, useMemo, useContext.

Middle
139

What is async/await? How does it differ from Promise?

Middle
130

What are var, let, const? How do they differ? What is hoisting?

Middle
126

Why did Redux Toolkit not suit you, and you switched to Effector?

Middle
125

What is NaN? Provide examples when NaN occurs. How to check if a value is NaN?

Middle
121

What is the difference between == and ===?

Middle
119

Tell us a little about yourself, your relevant experience, and what you are most proud of in your projects.

Middle
118

What is a higher-order function? Provide examples of built-in higher-order functions in JavaScript.

Middle
105

What HTTP methods do you know? How does PUT differ from PATCH?

Middle
88