console.log(foo); var foo = 1; console.log(foo); let foo = 2; console.log(foo); const foo = 3; console.log(foo);
Frontend
Have you had experience working with Legacy code?
Imagine a situation where performance drops due to a problem in JS code. What would you check in DevTools profiler to confirm or deny this hypothesis?
A array of 2 million elements arrives, each element needs to be processed for 100 milliseconds. Interaction with the server cannot be changed. How to process this array so as not to block the UI?
How do you feel about criticism during code review?
Please clarify: was the move from JS/JSVue to React and TypeScript, and is there a plan to move to micro frontends?
In the requestUserData function, three requests are executed sequentially. Why can't all three be wrapped in Promise.all? How to optimize this function to perform requests in the shortest time?
What is SSR (Server-Side Rendering)? Why use it and what should be considered when translating an application to SSR?
Why is it not recommended to store sensitive data in localStorage?
Have you had experience writing tests?
let a = 5; setTimeout(function timeout() { //macro console.log(a); a = 10; }, 0); let p = Promise.resolve().then(data => { console.log(a); a = 25; resolve(); }).then() console.log(a); // 5 25 25
Why shouldn't you make each component of an application a separate chunk via React.lazy? What problems could this create (with rendering, network, bundle size)?
There is a React application built into a single chunk. How to split it into several chunks and on what principle?
Tell us about the Event Loop in JavaScript.