swikarcodes

Free Tutorials

Cover image for undefined

Function, Array, Map, Spread Operator

This session builds on your fundamental JavaScript knowledge, introducing more powerful concepts and techniques that will enhance your coding capabilities. We'll cover important topics like scope, closures, and higher-order functions that are essential for writing more sophisticated JavaScript applications.

Key topics we'll explore today:

  • Variable scope and the differences between var, let, and const

  • Closures and how they capture variables

  • Higher-order functions and callback patterns

  • The 'this' keyword and its various contexts

  • Arrow functions and their lexical binding behaviors

  • Destructuring assignments for cleaner code

  • Template literals and string manipulation

  • JavaScript modules and imports/exports

By the end of today's session, you'll have a stronger foundation for writing more efficient, maintainable JavaScript code and be prepared to tackle more complex programming challenges.

Swikar Sharma

Swikar Codes

Cover image for undefined

Optional Chaining, Html, async and await

JavaScript in the browser is used to make web pages interactive. It can change content, handle user actions like clicks, and update styles. It works with the DOM (Document Object Model), which represents the structure of the webpage.

Swikar Sharma

Swikar Codes

Cover image for undefined

Git & Github Basics

Today, you learned how to track and manage code using Git, and how to collaborate with others using GitHub. You covered key commands like git init, git add, git commit, and git push, and practiced creating repositories, making commits, and pushing code to GitHub.

Swikar Sharma

Swikar Codes

Cover image for undefined

Server, Npm, Yarn and Bun

Node.js is a JavaScript runtime built on Chrome's V8 engine. It allows developers to run JavaScript code outside the browser, mainly used to build fast and scalable backend servers. Node.js uses an event-driven, non-blocking I/O model, making it efficient for handling multiple requests.

Use Cases:

  • REST APIs

  • Real-time applications (like chat apps)

  • Command-line tools

  • Backend services

React is a JavaScript library developed by Facebook for building user interfaces, especially for single-page applications. It allows developers to create reusable UI components and efficiently update the DOM using a virtual DOM.

Use Cases:

  • Frontend of web apps

  • Interactive UIs

  • Component-based architecture

Swikar Sharma

Swikar Codes

Cover image for undefined

UI Components, Hooks & State Management

UI Components

  • Reusable building blocks in React that define pieces of the interface.

  • Can be functional or class-based.

  • Receive props (data) from parents to customize display.

  • Manage their own state for interactive UI.


State Management

  • State is data that a component maintains and can change over time (e.g., user input, toggles).

  • Managed inside components using useState (functional components).

  • When state changes, React re-renders that component to update UI.

  • State can be "lifted up" to share between components.

  • For large apps, external state managers like Redux, MobX, or Context API help manage shared state globally.

Swikar Sharma

Swikar Codes

Cover image for undefined

React, JSON & API Integration

What is API Integration?

  • Connecting your React app with external data sources (APIs) to fetch or send data.

  • APIs usually provide data in JSON format.

  • React apps use API calls to display dynamic content.


Common Ways to Call APIs in React

  1. Using fetch() — built-in browser API to make HTTP requests.

  2. Axios — popular third-party library for HTTP requests.

  3. React Query or other data-fetching libraries for advanced caching & state.


Where to Call API in React?

  • Use the useEffect hook to call APIs after component mounts.

  • Update state with the fetched data to re-render UI.

Swikar Sharma

Swikar Codes

Cover image for undefined

React Patterns & Custom Hooks

React Patterns & Custom Hooks

React patterns are reusable solutions or best practices for structuring components, managing state, and handling side effects in React applications. Using established patterns helps write clean, maintainable, and scalable code.

Common React patterns include:

  • Container/Presentational Components: Separating UI and logic into different components.

  • Higher-Order Components (HOC): Functions that take a component and return a new component with enhanced behavior.

  • Render Props: Passing a function as a prop to dynamically determine what to render.

  • Compound Components: Components that work together to manage state and UI (like tabs or accordions).

  • Controlled vs Uncontrolled Components: Managing form elements either via React state (controlled) or letting DOM handle it (uncontrolled).

Custom Hooks are functions that let you extract and reuse stateful logic across components. They start with use and can encapsulate logic like data fetching, subscriptions, or form handling. Custom hooks improve code reuse and separation of concerns without changing component hierarchy.

Swikar Sharma

Swikar Codes

Cover image for undefined

TypeScript for React

TypeScript adds static typing to JavaScript, helping you catch errors early and write more maintainable React applications. When you use TypeScript with React, you get type safety for props, state, hooks, and component returns, which improves developer experience and code quality.


Key Concepts of TypeScript in React:

  • Typing Props: Define interfaces or types for component props.

  • Typing State: Use generics or type annotations with useState.

  • Typing Event Handlers: Specify event types for handlers like onClick, onChange.

  • Typing Refs: Use React.RefObject or useRef with type parameters.

  • Typing Functional Components: Use React.FC or explicit return types.

Swikar Sharma

Swikar Codes