Web Development - HTML, CSS & JavaScript
47.2K subscribers
1.43K photos
3 videos
32 files
265 links
Learn to code and become a Web Developer with HTML, CSS, JavaScript , Reactjs, Wordpress, PHP, Mern & Nodejs knowledge

Managed by: @love_data
Download Telegram
Here is a great JavaScript interview question!

What the heck is a Promise doing under the hood?

In JavaScript, things usually happen one after the other. It's like a checklist each item gets done before moving to the next.

When a function returns a Promise, it's like making a promise to do something, like fetch data from the internet. But JavaScript doesn't wait around for the data to come back. Instead, it moves on to the next task.

Now, here's where things get interesting. While JavaScript is busy doing other stuff, like running more code, the Promise is off fetching data in the background.

Once the data is fetched, the Promise is fulfilled, and it has some information to share. But JavaScript needs to know when it's time to handle that information. That's where the onFulfilled part of the Promise comes in.

When the Promise is fulfilled, JavaScript takes the onFulfilled code and puts it in a special queue, ready to be run.

Now, async/await enters the scene. When we mark a function as async, we're telling JavaScript, "Hey, this function might take some time to finish, so don't wait up for it."

And when we use the await keyword inside an async function, it's like saying, "Hold on a sec, JavaScript. I need to wait for something important before moving on."

So, when JavaScript encounters an await keyword, it pauses and lets the async function do its thing. If that thing happens to be a Promise, JavaScript knows it can move on to other tasks while waiting for the Promise to resolve.

Once the Promise is resolved, JavaScript picks up where it left off and continues running the code.

Promises and async/await allow JavaScript to handle asynchronous tasks while keeping things organized and in order. Promises handle the background tasks, while async/await makes it easier to work with them in our code, ensuring everything happens in the right sequence.

Web Development Best Resources: https://topmate.io/coding/930165

ENJOY LEARNING 👍👍
You can learn ReactJS easily 🤩

Here's all you need to get started 🙌

1.Components
• Functional Components
• Class Components
• JSX (JavaScript XML) Syntax

2.Props (Properties)
• Passing Props
• Default Props
• Prop Types

3.State
• useState Hook
• Class Component State
• Immutable State

4.Lifecycle Methods (Class Components)
• componentDidMount
• componentDidUpdate
• componentWillUnmount

5.Hooks (Functional Components)
• useState
• useEffect
• useContext
• useReducer
• useCallback
• useMemo
• useRef
• useImperativeHandle
• useLayoutEffect

6.Event Handling
• Handling Events in Functional Components
• Handling Events in Class Components

7.Conditional Rendering
• if Statements
• Ternary Operators
• Logical && Operator

8.Lists and Keys
• Rendering Lists
• Keys in React Lists

9.Component Composition
• Reusing Components
• Children Props
• Composition vs Inheritance

10.Higher-Order Components (HOC)
• Creating HOCs
• Using HOCs for Reusability

11.Render Props
• Using Render Props Pattern

12.React Router
• <BrowserRouter>
• <Route>
• <Link>
• <Switch>
• Route Parameters

13.Navigation
• useHistory Hook
• useLocation Hook

State Management

14.Context API
• Creating Context
• useContext Hook

15.Redux
• Actions
• Reducers
• Store
• connect Function (React-Redux)

16.Forms
• Handling Form Data
• Controlled Components
• Uncontrolled Components

17.Side Effects
• useEffect for Data Fetching
• useEffect Cleanup

18.AJAX Requests
• Fetch API
• Axios Library

Error Handling

19.Error Boundaries
• componentDidCatch (Class Components)
• ErrorBoundary Component (Functional
Components)

20.Testing
• Jest Testing Framework
• React Testing Library

21. Best Practices
• Code Splitting
• PureComponent and React.memo
•. PH4N745M
• Avoiding Reconciliation
• Keys for Dynamic Lists

22.Optimization
• Memoization
• Profiling and Performance Monitoring

23. Build and Deployment
• Create React App (CRA)
• Production Builds
• Deployment Strategies

Frameworks and Libraries

24.Styling Libraries
• Styled-components
• CSS Modules


25.State Management Libraries
• Redux
• MobX

26.Routing Libraries
• React Router
• Reach Router
⌨️ Top JavaScript Tricks for Cleaner Code 🚀