Tell me about useReducer — what is its purpose and how does it work?
Frontend
Tell me about XSS attacks: types and protection methods.
Tell me about Next.js: main advantages, rendering types, server components, and other features.
What is the difference between display: none and visibility: hidden?
Tell about useMemo, useCallback, and their interaction with React.memo. Features of interaction.
What is the difference between box-sizing: content-box and border-box?
Explain the difference between useEffect and useLayoutEffect, and where useLayoutEffect is useful?
How long does each function take to execute? ```javascript /** How long does each function take to execute */ function pause500ms () { return new Promise(res => setTimeout(res, 500)); } (async function test1 () { pause500ms(); pause500ms(); })(); (async function test2 () { await pause500ms(); await pause500ms(); })(); (async function test3 () { await Promise.all([pause500ms(), pause500ms()]); })(); (async function test4 () { await Promise.all([await pause500ms(), await pause500ms()]); })(); ```
What is React Portal, how does it work, and what are its features?
What is a generic in TypeScript?
How to make a component with 5 props ignore changes in three of them and re-render only when two change?