<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Salman Asu</title>
    <description>The latest articles on DEV Community by Salman Asu (@sallbro).</description>
    <link>https://dev.to/sallbro</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2011450%2F7b871d2d-8bfc-4057-ba5d-b2177f8e3693.png</url>
      <title>DEV Community: Salman Asu</title>
      <link>https://dev.to/sallbro</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sallbro"/>
    <language>en</language>
    <item>
      <title>important status code to be known as API developer</title>
      <dc:creator>Salman Asu</dc:creator>
      <pubDate>Wed, 08 Jan 2025 16:26:34 +0000</pubDate>
      <link>https://dev.to/sallbro/important-status-code-to-be-known-as-api-developer-oep</link>
      <guid>https://dev.to/sallbro/important-status-code-to-be-known-as-api-developer-oep</guid>
      <description>&lt;p&gt;&lt;strong&gt;success&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;200&lt;/code&gt; ok&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
use with &lt;strong&gt;get method&lt;/strong&gt; after receiving success response&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;201&lt;/code&gt; created&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
use with &lt;strong&gt;post method&lt;/strong&gt; when data is add or modify in database&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;client error&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;400&lt;/code&gt; bad request&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
use when user send wrong data with &lt;strong&gt;payload, parameter or query&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;401&lt;/code&gt; unauthorize&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
use when unauthorize user or without login user try to access the resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;403&lt;/code&gt; forbidden&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
use when user is authorize but not have permission to access the resources(&lt;code&gt;admin&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;404&lt;/code&gt; page not found&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
use when user try to access invalid route.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;server error&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;500&lt;/code&gt; internal server error&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
when something went wrong with code or server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;*&lt;em&gt;for more refer *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv6ocwzo5i723fbyeojkc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv6ocwzo5i723fbyeojkc.png" alt=" " width="800" height="1006"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>api</category>
      <category>statuscodes</category>
      <category>request</category>
      <category>response</category>
    </item>
    <item>
      <title>Load balancer vs Gateway vs reverse proxy vs forward proxy</title>
      <dc:creator>Salman Asu</dc:creator>
      <pubDate>Sat, 28 Dec 2024 11:01:20 +0000</pubDate>
      <link>https://dev.to/sallbro/load-balancer-vs-gateway-vs-reverse-proxy-vs-forward-proxy-49oe</link>
      <guid>https://dev.to/sallbro/load-balancer-vs-gateway-vs-reverse-proxy-vs-forward-proxy-49oe</guid>
      <description>&lt;p&gt;&lt;strong&gt;Today I will discuss about most use service in system design and difference between them.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhuryqmwajdr8mge42nsz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhuryqmwajdr8mge42nsz.png" alt=" " width="632" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;load balancer distribute load to different server according to algorithim set in load balancer configuration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficu2gny0fqqzrplcmtkm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ficu2gny0fqqzrplcmtkm.png" alt=" " width="640" height="594"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Gateway have additional + load balancer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;it can process the request and send response + distribute load to different server according to alogrithim set in load balancer configuration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;above I have discuss about two scenario.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyacxmmz5beevsthbwesz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyacxmmz5beevsthbwesz.png" alt=" " width="479" height="283"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;forward proxy is used to hide the user identity. it make a request to server on behave of client.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpk8nqozqnxyp1t3yj9g5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpk8nqozqnxyp1t3yj9g5.png" alt=" " width="479" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;reverce proxy is used to hide the server identity. it make a response to client on behave of server.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;simple request response using all the services in one system.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8nap2n7oz9k1re9nhpo0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8nap2n7oz9k1re9nhpo0.png" alt=" " width="800" height="287"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>systemdesign</category>
      <category>gateway</category>
      <category>proxy</category>
      <category>basic</category>
    </item>
    <item>
      <title>HTTP Headers in API</title>
      <dc:creator>Salman Asu</dc:creator>
      <pubDate>Mon, 23 Dec 2024 07:58:59 +0000</pubDate>
      <link>https://dev.to/sallbro/http-headers-in-api-9ec</link>
      <guid>https://dev.to/sallbro/http-headers-in-api-9ec</guid>
      <description>&lt;p&gt;http header are the field in http api request and response. &lt;/p&gt;

&lt;p&gt;it is like setting up the address from and to in sending envelop to postman.&lt;/p&gt;

&lt;p&gt;similarly http header are doing so.&lt;br&gt;
*&lt;em&gt;simple request header *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2z9f03eveyu6fnevw9p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2z9f03eveyu6fnevw9p.png" alt=" " width="800" height="354"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;response header for same request&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhylgc4h24gydivke9jg0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhylgc4h24gydivke9jg0.png" alt=" " width="800" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;** some of build in header are **&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;host&lt;/li&gt;
&lt;li&gt;path&lt;/li&gt;
&lt;li&gt;content-type
and many other refer &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" rel="noopener noreferrer"&gt;doc&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;_u can add own custom header. _&lt;br&gt;
like &lt;code&gt;req.setHeader("X-myname","sallbro");&lt;/code&gt;&lt;br&gt;
it is best practise to add &lt;strong&gt;X&lt;/strong&gt; before name of header to identify it is custom header.&lt;/p&gt;

</description>
      <category>api</category>
      <category>http</category>
      <category>request</category>
      <category>response</category>
    </item>
    <item>
      <title>flow design for access and refresh token- JWT</title>
      <dc:creator>Salman Asu</dc:creator>
      <pubDate>Thu, 19 Dec 2024 15:06:42 +0000</pubDate>
      <link>https://dev.to/sallbro/flow-design-for-access-and-refresh-token-jwt-2lh6</link>
      <guid>https://dev.to/sallbro/flow-design-for-access-and-refresh-token-jwt-2lh6</guid>
      <description>&lt;p&gt;&lt;strong&gt;let build low-level-design for the same.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;login the user with credential and validate it after…&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmgjllfb2gwd02t0xls6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkmgjllfb2gwd02t0xls6.png" alt=" " width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;one’s the token is store on both side server and client. if now user try to access the pages authenticate the user with that token’s&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdr2q90l3ddhsrve8refw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdr2q90l3ddhsrve8refw.png" alt=" " width="800" height="890"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;first validate the access token, if the access token is expire than validate the refresh token to generate new access token and refresh token.&lt;/p&gt;

&lt;p&gt;if refresh token is also expire than redirect the user to login route. after success credential generate new access token and refresh token and repeate the same cycle.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;note: every time when we generate new token, we generate both new access token and refersh token.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://sallbro.com" rel="noopener noreferrer"&gt;@sallbro&lt;/a&gt;&lt;/p&gt;

</description>
      <category>jwt</category>
      <category>systemdesign</category>
      <category>tokens</category>
    </item>
    <item>
      <title>comparing Domain-Driven Design (DDD) and Clean Architecture</title>
      <dc:creator>Salman Asu</dc:creator>
      <pubDate>Tue, 03 Dec 2024 09:40:57 +0000</pubDate>
      <link>https://dev.to/sallbro/comparing-domain-driven-design-ddd-and-clean-architecture-8d</link>
      <guid>https://dev.to/sallbro/comparing-domain-driven-design-ddd-and-clean-architecture-8d</guid>
      <description>&lt;p&gt;&lt;strong&gt;main difference between domain-driven design and clean architecture is we are seperating business login, infrastructure and presentation layer for &lt;code&gt;individual module&lt;/code&gt; in domain-driven design(DDD).&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;where seperating business login, infrastructure and presentation layer &lt;code&gt;onces for all module&lt;/code&gt; in clean architecture.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here’s a simplified folder structure comparing Domain-Driven Design (DDD) and Clean Architecture, ensuring clarity and scalability while reducing unnecessary depth.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;let take an example for creating folder structure for user and blog module...&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Domain-Driven Design (DDD)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
├── modules/                    # Feature-based modules
│   ├── user/                   # User module
│   │   ├── application/        # Use cases (business logic)
│   │   │   ├── create-user.usecase.ts
│   │   │   └── update-user.usecase.ts
│   │   ├── domain/             # Core business logic
│   │   │   ├── user.entity.ts
│   │   │   ├── user.repository.ts
│   │   │   └── user.validator.ts
│   │   ├── infrastructure/     # Data access and persistence
│   │   │   ├── user.repository.impl.ts
│   │   │   └── prisma.service.ts
│   │   ├── interfaces/         # Controllers, APIs, and DTOs
│   │   │   ├── user.controller.ts
│   │   │   ├── create-user.dto.ts
│   │   │   └── update-user.dto.ts
│   │   └── user.module.ts      # Module setup
│   ├── blog/                   # Blog module
│   │   ├── application/
│   │   ├── domain/
│   │   ├── infrastructure/
│   │   ├── interfaces/
│   │   └── blog.module.ts
├── shared/                     # Shared utilities and services
│   ├── exceptions/
│   │   └── custom-error.ts
│   ├── utils/
│   │   └── logger.service.ts
├── main.ts                     # Entry point
└── app.module.ts               # Root application module

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Clean Architecture&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
├── core/                       # Core application logic
│   ├── usecases/               # Application use cases
│   │   ├── create-user.usecase.ts
│   │   ├── update-user.usecase.ts
│   │   ├── create-blog.usecase.ts
│   │   └── update-blog.usecase.ts
│   ├── entities/               # Domain models/entities
│   │   ├── user.entity.ts
│   │   ├── blog.entity.ts
│   │   └── index.ts
│   ├── repositories/           # Repository interfaces
│   │   ├── user.repository.ts
│   │   ├── blog.repository.ts
│   │   └── index.ts
│   └── validators/             # Domain-level validations
│       ├── user.validator.ts
│       ├── blog.validator.ts
│       └── index.ts
├── adapters/                   # Adapters for data and frameworks
│   ├── database/               # Database layer
│   │   ├── prisma/
│   │   │   ├── schema.prisma
│   │   │   ├── prisma.service.ts
│   │   │   └── user.repository.impl.ts
│   │   └── blog.repository.impl.ts
│   └── controllers/            # Controllers (API endpoints)
│       ├── user.controller.ts
│       ├── blog.controller.ts
│       └── index.ts
├── config/                     # Configuration files
│   └── app.config.ts
├── shared/                     # Shared utilities
│   ├── exceptions/
│   │   └── custom-error.ts
│   ├── utils/
│   │   └── logger.service.ts
│   └── index.ts
├── main.ts                     # Entry point
└── app.module.ts               # Root application module

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Choose DDD if the application is domain-complex and feature-based, or Clean Architecture if you want to prioritize clear separation of layers. Let me know which one resonates!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;want to know more about me, just write &lt;strong&gt;&lt;a href="//sallbro.com"&gt;sallbro&lt;/a&gt;&lt;/strong&gt; on search engine...&lt;/em&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>typescript</category>
      <category>nestjs</category>
    </item>
    <item>
      <title>All About Typescript For Javascript Developer</title>
      <dc:creator>Salman Asu</dc:creator>
      <pubDate>Fri, 22 Nov 2024 08:59:18 +0000</pubDate>
      <link>https://dev.to/sallbro/all-about-typescript-for-javascript-developer-3aim</link>
      <guid>https://dev.to/sallbro/all-about-typescript-for-javascript-developer-3aim</guid>
      <description>&lt;p&gt;&lt;strong&gt;interface:&lt;/strong&gt;&lt;br&gt;
to define the structure or shape of an object and specify the properties and methods that an object has or should have.&lt;br&gt;
interface is built-in feature of typescript.&lt;br&gt;
use interface if it possible instead of types.&lt;br&gt;
usecase type checking, easier debugging&lt;br&gt;
&lt;strong&gt;&lt;code&gt;we can use interface at different level at:&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;function type use interface to their argument or return value.&lt;/li&gt;
&lt;li&gt;class in object constructor&lt;/li&gt;
&lt;li&gt;Optional properties&lt;/li&gt;
&lt;li&gt;readonly properties&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;types alias:&lt;/strong&gt;&lt;br&gt;
u can create a complex type by combining multiple type.&lt;br&gt;
One major difference between type aliases vs interfaces, are that interfaces are open and type aliases are closed.&lt;br&gt;
=&amp;gt;This means you can extend an interface by declaring it a second time.&lt;br&gt;
e.g&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface Kitten {
  purrs: boolean;
}

interface Kitten {
  colour: string;
}

// In the other case a type cannot be changed outside of
// its declaration.

type Puppy = {
  color: string;
};

type Puppy = {
  toys: number;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;=&amp;gt;we can event extent the type with intersection type (&amp;amp;) &lt;br&gt;
e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type UserEvent = PlayEvent &amp;amp; {UserId: string}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;extend keyword can be use with interface or class&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;unions:&lt;/strong&gt;&lt;br&gt;
Union types in TypeScript allow us to define a variable or parameter that can hold values of multiple types. &lt;br&gt;
Use pipe &lt;code&gt;(|)&lt;/code&gt; symbol to combine two or more data types to achieve Union type.&lt;br&gt;
e.g&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const randomtype= string | number
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, you can describe a boolean type as being either true or false:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;type MyBool = true | false;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;casting:&lt;/strong&gt;&lt;br&gt;
converting type into another type&lt;br&gt;
e.g&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let x: unknown = 'hello';
console.log((x as string).length);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;generics:&lt;/strong&gt;&lt;br&gt;
defining varaible to type&lt;br&gt;
e.g when value of type is unkown while creating or defining a function, but known after calling a function, we use generic&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function myfun&amp;lt;type&amp;gt;(arg:type):type{
     return arg;
    }
    myfun&amp;lt;number&amp;gt;(3);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;type inside a type, u can defined generics at array, map or set.&lt;br&gt;
we can declare own type that use generics&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;duck or structure typing:&lt;/strong&gt;&lt;br&gt;
This technique is used to compare two objects are identical in terms of having matching properties and methods(Type-checking).&lt;br&gt;
e.g&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Pigeon {
  sound = "coos";
}

class Owl {
  sound = "hoots";
}

class Penguin {
  sound = "peeps";
  swim() {
    console.log("I'm a bird and i can swim");
  }
}

let pigeon: Pigeon = new Owl();      // Works
let owl: Owl = new Pigeon();         // Works
let pigeon2: Pigeon = new Penguin(); // Works
let penguin: Penguin = new Pigeon(); // Compile time error
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;enums:&lt;/strong&gt;&lt;br&gt;
it is a way to defining set of constant in typescript, collection of related value of different data type.&lt;br&gt;
&lt;strong&gt;&lt;code&gt;usecases-&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
Enums provides a great way to organize the code in TypeScript.&lt;br&gt;
Enums saves compile-time and runtime with inline code in JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tuples:&lt;/strong&gt;&lt;br&gt;
In JavaScript, arrays consist of values of the same type, but sometimes we need to store a collection of values of different types in a single variable.&lt;br&gt;
e,g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let arrTuple: [number, string, number, string] = [501, "welcome", 505, "Mohan"];
console.log(arrTuple);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;satisfies:&lt;/strong&gt;&lt;br&gt;
The satisfies operator is used to ensure that a value conforms to a specific type without changing the type of the value itself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;any and unkown:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;any&lt;/code&gt;- mean anything&lt;br&gt;
&lt;code&gt;unkown&lt;/code&gt;- mean it is unkown now but it is kown or declare later&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;keyof:&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;keyof&lt;/code&gt; is a keyword in TypeScript which is used to extract the key type from an object type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;decorator:&lt;/strong&gt;&lt;br&gt;
its a special kind of declartion can be appleied to class, methods, argument, variable&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Type assertions:&lt;/strong&gt;&lt;br&gt;
Type assertion is a technique that informs the compiler about the type of a variable.&lt;br&gt;
Type assertion is similar to typecasting but it doesn’t reconstruct code. &lt;br&gt;
You can use type assertion to specify a value’s type and tell the compiler not to deduce it.&lt;br&gt;
e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let str: unknown = "geeksforgeeks"; 
     console.log(str); 
     let len: number = (str as string).length; 
     console.log(len);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;function overloading and overwritting:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;code&gt;overloading&lt;/code&gt;&lt;/strong&gt;- i.e. changing number of parameters, change datatype of parameters, return type doesn’t play any role. &lt;br&gt;
achieved at compile time.&lt;br&gt;
&lt;strong&gt;&lt;code&gt;overwriting&lt;/code&gt;&lt;/strong&gt;-It is the redefinition of base class function in its derived class with same signature i.e. return type and parameters.&lt;br&gt;
It can only be done in derived class. &lt;br&gt;
achieved at run time.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;want to know more about me, just write &lt;strong&gt;&lt;a href="//sallbro.com"&gt;sallbro&lt;/a&gt;&lt;/strong&gt; on search engine...&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>All About Javascript For Intermediate</title>
      <dc:creator>Salman Asu</dc:creator>
      <pubDate>Fri, 22 Nov 2024 08:49:15 +0000</pubDate>
      <link>https://dev.to/sallbro/all-about-javascript-for-intermediate-53ee</link>
      <guid>https://dev.to/sallbro/all-about-javascript-for-intermediate-53ee</guid>
      <description>&lt;p&gt;&lt;strong&gt;what is javascript&lt;/strong&gt;:&lt;br&gt;
javascript is an open source programing language. which help to create a dynamic web pages. it is also as browser language.&lt;br&gt;
It can run on both the client-side (in browsers) and server-side (using environments like Node.js).&lt;br&gt;
JavaScript supports event-driven, non-blocking, and asynchronous programming, which is essential for handling multiple tasks simultaneously.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;varaible&lt;/strong&gt;:&lt;br&gt;
varaible are the container to store data&lt;br&gt;
types of varaible&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;var&lt;/li&gt;
&lt;li&gt;let &lt;/li&gt;
&lt;li&gt;const&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;operators&lt;/strong&gt;:&lt;br&gt;
Javascript operators are used to perform different types of mathematical and logical computations.&lt;br&gt;
types of operators &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;arithmetic = +,-,/,%,*&lt;/li&gt;
&lt;li&gt;comparison&lt;/li&gt;
&lt;li&gt;logical&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;data type&lt;/strong&gt;&lt;br&gt;
define the type of varaible&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;primitive data type = store the value by value&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;String&lt;/li&gt;
&lt;li&gt;Number&lt;/li&gt;
&lt;li&gt;Bigint&lt;/li&gt;
&lt;li&gt;Boolean&lt;/li&gt;
&lt;li&gt;Undefined = we declare the variable, value is not defined. datatype is undefined&lt;/li&gt;
&lt;li&gt;Null = it is an assign value, we explicitly set the value as null. datatype is object&lt;/li&gt;
&lt;li&gt;Symbol&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;non premitive data type = store the value by reference(address)&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Object = Built-in object types can be: objects, arrays, dates, maps, sets, intarrays, floatarrays, promises&lt;/li&gt;
&lt;li&gt;example:&lt;/li&gt;
&lt;li&gt;null == undefined is true, but null === undefined is false.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The main difference between export and export default in JavaScript ?&lt;/strong&gt;&lt;br&gt;
is that export default is used to export a single value from a module,&lt;br&gt;
while export with named exports is used to export multiple values&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;the main difference between primitive and non-primitive data types ?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;is that primitive types are predefined, while non-primitive types are created by the programmer.&lt;/li&gt;
&lt;li&gt;Primitive and Non-Primitive data structure that allows you to store only single data type values and to store multiple data type values.
Primitive data types are stored directly in memory, whereas non-primitive data types are stored as references to their values in memory.&lt;/li&gt;
&lt;li&gt;primitive data types are passed by value and non-primitive data types are passed by reference.&lt;/li&gt;
&lt;li&gt;Primitive data types are immutable, meaning their values cannot be changed once assigned. Non-primitive data types are mutable and can be modified.&lt;/li&gt;
&lt;li&gt;Numbers, strings, and booleans are examples of primitive data types, while objects, arrays, and functions are examples of non-primitive data types.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;function&lt;/strong&gt;:&lt;br&gt;
A JavaScript function is a block of code designed to perform a particular task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is javascript a statically typed or a dynamically typed language?&lt;/strong&gt;&lt;br&gt;
JavaScript is a dynamically typed language. In a dynamically typed language, &lt;br&gt;
the type of a variable is checked during run-time in contrast to a statically typed language, &lt;br&gt;
where the type of a variable is checked during compile-time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explain passed by value and passed by reference ?&lt;/strong&gt;&lt;br&gt;
In JavaScript, primitive data types are passed by value and non-primitive data types are passed by reference.&lt;br&gt;
&lt;code&gt;primitive data types&lt;/code&gt; = string, number, boolean, null, undefined&lt;br&gt;
&lt;code&gt;non-primitive data types&lt;/code&gt; = objects, arrays&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What do you mean by strict mode in javascript and characteristics of javascript strict-mode ?&lt;/strong&gt;&lt;br&gt;
allows you to write a code or a function in a &lt;code&gt;strict&lt;/code&gt; operational environment. &lt;br&gt;
As a result, debugging becomes a lot simpler.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are factory functions in JavaScript ?&lt;/strong&gt; &lt;br&gt;
If we have complex logic, and we have to create multiple objects again and again that have the same logic, &lt;br&gt;
we can write the logic once in a function and use that function as a factory to create our objects. &lt;br&gt;
It’s the same as a real-world factory producing products.&lt;br&gt;
a factory function is a function that returns an object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Higher Order Functions:&lt;/strong&gt;&lt;br&gt;
fuction take other fuction as an argument or return the function.&lt;br&gt;
map, filter and reduce function are all example of HOF.&lt;br&gt;
Higher-order functions are useful for tasks like event handling, data transformation (e.g., map and filter), and creating function factories or decorators.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Closures:&lt;/strong&gt;&lt;br&gt;
Closures are created when a function is defined inside another function, &lt;br&gt;
and the inner function retains access to the variables and method in the outer function's scope&lt;br&gt;
Closure provides a means to encapsulate data within functions, allowing for controlled access to that data while keeping it hidden from the outside scope.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;callbacks:&lt;/strong&gt;&lt;br&gt;
Functions that are used as an argument to another function are called callback functions.&lt;br&gt;
A callback is a function that will be executed after another function gets executed.&lt;br&gt;
usecase of callback function when we want to perform asynchronous operation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;map() vs forEach()&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;map()&lt;/code&gt;=&amp;gt; Iterates over each element of an array and applies a transformation function to each element.&lt;br&gt;
Does not modify the original array; it creates a new array with transformed elements.&lt;br&gt;
&lt;code&gt;forEach()&lt;/code&gt;=&amp;gt; Iterates over each element of an array and executes a provided callback function for each element.&lt;br&gt;
Does not create a new array or modify the existing array; it only executes the callback function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;map() vs filter() vs reduce()&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;map()&lt;/code&gt;it will return new array&lt;br&gt;
&lt;code&gt;filter()&lt;/code&gt; it is similar to map() it also return new array but if the condition is true. used when we want to apply condition.&lt;br&gt;
&lt;code&gt;reduce()&lt;/code&gt; it will return single value from an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;this keyword:&lt;/strong&gt;&lt;br&gt;
The value of the &lt;code&gt;this&lt;/code&gt; keyword will always depend on the object that is invoking the function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;currying:&lt;/strong&gt;&lt;br&gt;
transform a function of n argument to n function.&lt;br&gt;
usecase enabling partial application(when you have a function that takes multiple arguments, but you only want to fix some of them, while leaving others open for later use), &lt;br&gt;
reuse of code.&lt;br&gt;
e.g&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function add (a) {
  return function(b){
    return a + b;
  }
}
add(3)(4)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;normal vs arrow function ?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;code&gt;normal function:&lt;/code&gt;&lt;/strong&gt; &lt;br&gt;
this refer to the object which call the function&lt;br&gt;
can be use as a constructor&lt;br&gt;
Function declarations are hoisted(allow hosting)&lt;br&gt;
&lt;strong&gt;&lt;code&gt;arrow function:&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
do not have their own this&lt;br&gt;
cannot be use as a constructor&lt;br&gt;
Function declarations are not hoisted(not allow hosting) // myfunc is not a function&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;normal and ternary condition ?&lt;/strong&gt;&lt;br&gt;
ternary condition store the refence without this context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is the difference between exec () and test () methods in javascript ?&lt;/strong&gt;&lt;br&gt;
test () and exec () are RegExp expression methods used in javascript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;some advantages of using External JavaScript?&lt;/strong&gt;&lt;br&gt;
We can reuse the code.&lt;br&gt;
Code readability is simple in external javascript(code modularization)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;prototype:&lt;/strong&gt;&lt;br&gt;
The JavaScript prototype property also allows you to add new properties and methods to objects constructors.&lt;br&gt;
usecase for testing &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;memoization:&lt;/strong&gt;&lt;br&gt;
Memoization is a form of caching where the return value of a function is cached based on its parameters. &lt;br&gt;
If the parameter of that function is not changed, the cached version of the function is returned.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DOM:&lt;/strong&gt;&lt;br&gt;
DOM stands for Document Object Model. DOM is a programming interface for HTML.&lt;br&gt;
When the browser tries to render an HTML document, it create a DOM&lt;br&gt;
Using this DOM, we can manipulate or change various elements inside the HTML document.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BOM:&lt;/strong&gt;&lt;br&gt;
Browser Object Model is known as BOM. It allows users to interact with the browser.&lt;br&gt;
A browser's initial object is a window. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Promises:&lt;/strong&gt;&lt;br&gt;
Promises are used to handle asynchronous operations in javascript. Before promises, callbacks were used to handle asynchronous operations.&lt;br&gt;
&lt;strong&gt;&lt;code&gt;Promise object has four states -&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Pending&lt;/code&gt;- Initial state of promise. &lt;br&gt;
&lt;code&gt;Fulfilled&lt;/code&gt;- This state represents that the promise has been fulfilled,.&lt;br&gt;
&lt;code&gt;Rejected&lt;/code&gt;- This state represents that the promise has been rejected.&lt;br&gt;
&lt;code&gt;Settled&lt;/code&gt;- This state represents that the promise has been either rejected or fulfilled.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;async/await:&lt;/strong&gt;&lt;br&gt;
it is built on top of promises, it provide more consise way to write async code, making it easier to read and write.&lt;br&gt;
async keyword is used to declare synction function and await is used to wait for promises to be resolved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;express vs structure&lt;/strong&gt;&lt;br&gt;
=&amp;gt;express is which return some value&lt;br&gt;
e.g&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const x=5;
const y=myfun();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;5 and myfun()&lt;/code&gt; return some value is an expression&lt;br&gt;
statement which instruct and order action, but does not return value &lt;br&gt;
e.g.&lt;code&gt;if,else,&lt;/code&gt; while are those are statement&lt;br&gt;
&lt;code&gt;while(i&amp;lt;2){}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;rest parameter and spread operator:&lt;/strong&gt;&lt;br&gt;
rest parameter it combined the separate element into an array&lt;br&gt;
spread operator is used to seperate array into single element&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;generator functions ?&lt;/strong&gt;&lt;br&gt;
They can be stopped midway and then continue from where they had stopped.&lt;br&gt;
The generator object consists of a method called next(), this method when called, executes the code until the nearest yield statement, and returns the yield value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;call(),apply() and bind():&lt;/strong&gt;&lt;br&gt;
all these are use to assing object to this keyword(assign value to this keyword)&lt;br&gt;
usecase when we want to manipulate this keyword of a fuction with desired object&lt;br&gt;
&lt;strong&gt;&lt;code&gt;The bind() method&lt;/code&gt;&lt;/strong&gt; creates a new function that, when called, has its this keyword set to the provided value(e.g object). it create a new object.&lt;br&gt;
&lt;strong&gt;&lt;code&gt;call() and apply()&lt;/code&gt;&lt;/strong&gt; serve the exact same purpose. The call() method does not make a copy of the function it is being called on.&lt;br&gt;
The only difference between how they work is that call() expects all parameters to be passed in individually, &lt;br&gt;
whereas apply() expects an array of all of our parameters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IIFE:&lt;/strong&gt;&lt;br&gt;
immediately invoked function that run as soon as it defined.&lt;br&gt;
e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(function(){ 
  // Do something;
})();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;pure function:&lt;/strong&gt;&lt;br&gt;
produce same output for same input. It takes place when the operands of an expression are of different data types.&lt;br&gt;
function which does not modify the external state or varaible&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is javascript a statically typed or a dynamically typed language?&lt;/strong&gt;&lt;br&gt;
In a dynamically typed language, the type of a variable is checked during run-time in contrast to a statically typed language, &lt;br&gt;
where the type of a variable is checked during compile-time.&lt;br&gt;
e.g.&lt;br&gt;
static type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;string name="salman"; 
// varaible has types
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;dynamic type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var name="salman"; 
// convert into string at runtime
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;coercoin:&lt;/strong&gt;&lt;br&gt;
the automatic conversion of value from one data type to another.&lt;br&gt;
&lt;strong&gt;&lt;code&gt;String coercion&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;+&lt;/code&gt; convert the number into string&lt;br&gt;
&lt;code&gt;-&lt;/code&gt; convert string into number&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NaN():&lt;/strong&gt;&lt;br&gt;
isNaN() function converts the given value to a Number type, and then equates to NaN.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ASP script v/s javascript ?&lt;/strong&gt;&lt;br&gt;
ASP script runs on the server, while JavaScript runs on the client's browser.&lt;br&gt;
ASP script is a server-side language used for handling complex tasks, such as database queries, form submissions, and user authentication. &lt;br&gt;
while JavaScript is a client-side language used for creating interactive elements on web pages, such as animations, pop-up windows, and form validation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Undefined Value:&lt;/strong&gt;&lt;br&gt;
value is not defined but variable is present&lt;br&gt;
missing property in an object&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;eslint:&lt;/strong&gt;&lt;br&gt;
it help to debug and fine common vulnerablity in javascript code&lt;/p&gt;

&lt;p&gt;&lt;em&gt;want to know more about me, just write &lt;strong&gt;&lt;a href="//sallbro.com"&gt;sallbro&lt;/a&gt;&lt;/strong&gt; on search engine...&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>interview</category>
    </item>
    <item>
      <title>Full Guide For React Developer</title>
      <dc:creator>Salman Asu</dc:creator>
      <pubDate>Fri, 22 Nov 2024 06:46:05 +0000</pubDate>
      <link>https://dev.to/sallbro/full-guide-for-react-developer-41pf</link>
      <guid>https://dev.to/sallbro/full-guide-for-react-developer-41pf</guid>
      <description>&lt;p&gt;this post will help to understand all concept need to start working with projects.&lt;/p&gt;

&lt;p&gt;let's begin !&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(DOM) is a programming interface for web documents(page).&lt;/strong&gt; &lt;br&gt;
so that programs can change the document structure, style, and content. &lt;br&gt;
The DOM represents the document as nodes and objects; that way, programming languages can interact with the page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A component's lifecycle?&lt;/strong&gt;&lt;br&gt;
has three main phases: the Mounting Phase, the Updating Phase, and the Unmounting Phase.&lt;br&gt;
The &lt;code&gt;Mounting&lt;/code&gt;Phase begins when a component is first created and inserted into the DOM. &lt;br&gt;
The &lt;code&gt;Updating&lt;/code&gt;Phase occurs when a component's state or props change. &lt;br&gt;
And the &lt;code&gt;Unmounting&lt;/code&gt;Phase occurs when a component is removed from the DOM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;what is components ?&lt;/strong&gt;&lt;br&gt;
Components are independent and reusable bits of code. &lt;br&gt;
They serve the same purpose as JavaScript functions, but work in isolation and return HTML. &lt;br&gt;
Components come in two types, Class components and Function components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Class components and Function components difference ?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;class components is more usefull when we want more controlled over every stage of lifecyle methode.&lt;/li&gt;
&lt;li&gt;class component is traditional way for creating component.&lt;/li&gt;
&lt;li&gt;with the help of hooks even now functional component can managed state. hooks was released in react 13.&lt;/li&gt;
&lt;li&gt;Function components were considered "state-less". With the addition of Hooks, Function components are now almost equivalent to Class components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;react condition ?&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Logical &amp;amp;&amp;amp; Operator: 
e.g
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{cars.length &amp;gt; 0 &amp;amp;&amp;amp;
      &amp;lt;h2&amp;gt;
        You have {cars.length} cars in your garage.
      &amp;lt;/h2&amp;gt;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Ternary Operator: e.g
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;condition ? true : false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;usestate() ?&lt;/strong&gt;&lt;br&gt;
it is similar to variable in programming language. where we can store and update data or state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useeffect() ?&lt;/strong&gt;&lt;br&gt;
it execute once when the component is created. and excute when there any change state added in depencency injection.&lt;br&gt;
allow you to perform side effects such fetching data from an API, updating the DOM, or subscribing to an event.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useLayoutEffect() ?&lt;/strong&gt;&lt;br&gt;
The useLayoutEffect hook is similar to useEffect, but it’s executed synchronously after all DOM mutations.&lt;br&gt;
This makes it useful for manipulating the DOM immediately after a component is rendered.&lt;br&gt;
e.g. use useLayoutEffect to measure the size of an element&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useReducer() ?&lt;/strong&gt;&lt;br&gt;
The useReducer Hook is similar to the useState Hook.&lt;br&gt;
use when we want to manage more complex state management.&lt;br&gt;
The useReducer Hook returns the current state and a dispatch method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;usecontext() ?&lt;/strong&gt;&lt;br&gt;
This hook in React is used to consume values from a React context.&lt;br&gt;
It allows functional components to access the value provided by a context provider higher up in the component tree without the need for prop drilling.&lt;br&gt;
Create a context e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const MyContext = React.createContext();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Provide a value using Context Provider e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;MyContext.Provider value={value}&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Consume the context value using &lt;code&gt;useContext&lt;/code&gt; e.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const contextValue = useContext(MyContext);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;e.g. React Context is a way to manage state globally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useCallback() ?&lt;/strong&gt;&lt;br&gt;
Memoizes a function, preventing it from being recreated on every render if the dependencies remain unchanged. &lt;br&gt;
Useful for optimizing performance by avoiding unnecessary re-renders of child components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useMemo() ?&lt;/strong&gt;&lt;br&gt;
It memoizes a value, preventing it from being recomputed on every render if the dependencies remain unchanged. &lt;br&gt;
It’s useful for optimizing expensive calculations or complex data transformations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useref() ?&lt;/strong&gt;&lt;br&gt;
The useRef Hook allows you to persist values between renders.&lt;br&gt;
It can be used to store a mutable value that does not cause a re-render when updated.&lt;br&gt;
It can be used to access a DOM element directly.&lt;br&gt;
Often used for accessing or manipulating DOM elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useimperativehandle() ?&lt;/strong&gt;&lt;br&gt;
hook allows you to customize the instance value that is exposed to parent components when using ref. &lt;br&gt;
it's like certain adding interface to parenet components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;usedebugvalue() ?&lt;/strong&gt;&lt;br&gt;
that allows you to display custom debugging information for custom hooks in the React DevTools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explain the building blocks of React ?&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;Components&lt;/code&gt;: These are reusable blocks of code that return HTML.&lt;br&gt;
&lt;code&gt;JSX&lt;/code&gt;: It stands for JavaScript and XML and allows to write HTML in React.&lt;br&gt;
&lt;code&gt;Props and State&lt;/code&gt;: props are like function parameters and State is similar to variables.&lt;br&gt;
&lt;code&gt;Context&lt;/code&gt;: This allows data to be passed through components as props in a hierarchy.&lt;br&gt;
&lt;code&gt;Virtual DOM&lt;/code&gt;: It is a lightweight copy of actual DOM which makes DOM manipulation easier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ReactJS Reconciliation ?&lt;/strong&gt;&lt;br&gt;
React Reconciliation is the process through which React updates the Browser DOM.&lt;br&gt;
It updates the virtual DOM first and then uses the diffing algorithm to make efficient and optimized updates in the Real DOM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React pure components ?&lt;/strong&gt;&lt;br&gt;
React pure components are the components that do not re-render when the value of props and state has been updated with the same values.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;want to know more about me, just write &lt;strong&gt;&lt;a href="//sallbro.com"&gt;sallbro&lt;/a&gt;&lt;/strong&gt; on search engine...&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>jsx</category>
    </item>
    <item>
      <title>Jumping From Javascript To Typscript Concept Should be Known</title>
      <dc:creator>Salman Asu</dc:creator>
      <pubDate>Tue, 19 Nov 2024 13:24:08 +0000</pubDate>
      <link>https://dev.to/sallbro/jumping-from-javascript-to-typscript-concept-should-be-known-2odd</link>
      <guid>https://dev.to/sallbro/jumping-from-javascript-to-typscript-concept-should-be-known-2odd</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;really u want to learn ?&lt;br&gt;
seriously !&lt;br&gt;
let's begin,&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s a list of concepts to be aware of:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Types and Type Annotations&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Basic Types&lt;/strong&gt;: Understand the difference between &lt;code&gt;string&lt;/code&gt;, &lt;code&gt;number&lt;/code&gt;, &lt;code&gt;boolean&lt;/code&gt;, &lt;code&gt;any&lt;/code&gt;, &lt;code&gt;void&lt;/code&gt;, &lt;code&gt;undefined&lt;/code&gt;, &lt;code&gt;null&lt;/code&gt;, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Type Annotations&lt;/strong&gt;: Learn how to declare types explicitly (e.g., &lt;code&gt;let age: number = 30;&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Type Inference&lt;/strong&gt;: TypeScript can infer types from context, but understanding when to use explicit types and when to rely on inference is important.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Union Types&lt;/strong&gt;: Types can be a combination of multiple types (e.g., &lt;code&gt;let value: string | number)&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Literal Types&lt;/strong&gt;: Types that can be specific values (e.g., &lt;code&gt;let direction: 'left' | 'right';&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Interfaces and Type Aliases&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Interfaces&lt;/strong&gt;: Used to define object shapes (e.g., &lt;code&gt;interface User { name: string; age: number }&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Type Aliases&lt;/strong&gt;: Allows you to create custom types (e.g., &lt;code&gt;type ID = string | number;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Differences between Interfaces and Types&lt;/strong&gt;: Interfaces are extendable, while type aliases are more flexible (can define primitives, unions, intersections, etc.).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Generics&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Generic Functions&lt;/strong&gt;: Functions that can work with multiple types (e.g., &lt;code&gt;function identity&amp;lt;T&amp;gt;(arg: T): T { return arg; }&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Generic Interfaces/Classes&lt;/strong&gt;: Apply generics to interfaces and classes (e.g., &lt;code&gt;interface Box&amp;lt;T&amp;gt; { value: T; }&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Type Assertion and Casting&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Type Assertions&lt;/strong&gt;: Tells TypeScript that you know more about the type than it does (e.g., &lt;code&gt;let value = someValue as string&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Non-Null Assertion&lt;/strong&gt;: Use ! to tell TypeScript that a value is not null or undefined (e.g., &lt;code&gt;someVar!.doSomething()&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Structural Typing (Duck Typing)&lt;/strong&gt;&lt;br&gt;
In TypeScript, types are structural, meaning that types are compared based on their properties, not their names. If two types have the same structure, they are considered the same type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Enums&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Numeric and String Enums&lt;/strong&gt;: Allows you to define a set of named constants (e.g., &lt;code&gt;enum Direction { Up, Down, Left, Right }&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Const Enums&lt;/strong&gt;: A more efficient form of enums when no reverse mapping is needed (e.g., &lt;code&gt;const enum Color { Red, Green, Blue }&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7. Type Narrowing&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Type Guards&lt;/strong&gt;: Use &lt;code&gt;typeof&lt;/code&gt;, &lt;code&gt;instanceof&lt;/code&gt;, or custom type predicates to narrow down the type of a variable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discriminated Unions&lt;/strong&gt;: Combining union types with a common property (discriminator) to narrow down types (e.g., &lt;code&gt;type Circle = { kind: "circle"; radius: number };&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;8. Advanced Types&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Intersection Types&lt;/strong&gt;: Combine multiple types into one (e.g., type AdminUser = User &amp;amp; Admin;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mapped Types&lt;/strong&gt;: Allows you to transform properties in a type (e.g., type ReadOnly = { readonly [P in keyof T]: T[P]; }).
Utility Types: Built-in types that simplify common type transformations, such as Partial, Pick, Omit, Record, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;9. Modules and Namespaces&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ES Modules&lt;/strong&gt;: TypeScript supports ES6 module syntax (e.g., &lt;code&gt;import&lt;/code&gt;/&lt;code&gt;export&lt;/code&gt;). Understanding module resolution and the difference between default and named exports is essential.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Namespaces&lt;/strong&gt;: TypeScript also has its own namespace system, but it's generally discouraged in favor of ES modules for modern codebases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;10. Handling JavaScript Libraries&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DefinitelyTyped&lt;/strong&gt;: Learn how to install and use type definitions for JavaScript libraries that don't provide their own types (e.g., &lt;code&gt;via @types/lodash&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Declaring Types for 3rd-Party Libraries&lt;/strong&gt;: Know how to write custom type declarations (&lt;code&gt;*.d.ts&lt;/code&gt; files) for libraries or global objects when no types are available.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;11. Classes and Inheritance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript Classes&lt;/strong&gt;: Similar to JavaScript classes but with additional type-checking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Access Modifiers&lt;/strong&gt;: &lt;code&gt;public&lt;/code&gt;, &lt;code&gt;private&lt;/code&gt;, &lt;code&gt;protected&lt;/code&gt;keywords control the visibility of class members.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Readonly&lt;/strong&gt;: Marks properties as read-only (e.g., &lt;code&gt;readonly id: number&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Abstract Classes and Methods&lt;/strong&gt;: Abstract classes cannot be instantiated directly and are meant to be subclassed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;12. Async/Await and Promises&lt;/strong&gt;&lt;br&gt;
TypeScript has full support for async/await and Promises, but adding type annotations can help avoid issues with types like Promise or async function.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13. Decorators&lt;/strong&gt;&lt;br&gt;
Experimental Feature: Decorators are a special syntax for annotating or modifying classes and class members. Useful in frameworks like Angular, but still experimental in TypeScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14. Strict Type-Checking Options&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Strict Mode&lt;/strong&gt;: Enables stricter type-checking options (e.g., &lt;code&gt;strictNullChecks, noImplicitAny&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;tsconfig.json&lt;/strong&gt;: Learn how to configure TypeScript using this file to enable or disable compiler options.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;15. TypeScript and JavaScript Interoperability&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Working with JavaScript Code&lt;/strong&gt;: TypeScript is fully compatible with JavaScript. You can gradually introduce TypeScript into an existing JavaScript project and still call JavaScript from TypeScript and vice versa.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;JSDoc Comments&lt;/strong&gt;: You can use JSDoc-style comments in JavaScript to provide type information to TypeScript, which is useful in mixed JS/TS codebases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;16. Error Handling&lt;/strong&gt;&lt;br&gt;
TypeScript helps catch common errors at compile time, such as accessing properties on null or undefined. Understanding how to use try/catch in TypeScript, along with proper type annotations, is important.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;17. TypeScript Configuration (tsconfig.json)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Compiler Options&lt;/strong&gt;: Learn how to configure compiler settings, including module resolution, strictness settings, and target environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source Maps&lt;/strong&gt;: Set up source maps to make debugging TypeScript in the browser or Node.js easier.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;18. Utility Functions and Types&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;keyof, typeof, instanceof&lt;/strong&gt;: Understand these utility operators and how to use them to extract and manipulate types.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Index Signatures&lt;/strong&gt;: Allow you to define the types of keys and values for objects dynamically (e.g., &lt;code&gt;[key: string]: any&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;19. Conditional Types&lt;/strong&gt;&lt;br&gt;
TypeScript allows defining types based on conditions (e.g., &lt;code&gt;type IsString&amp;lt;T&amp;gt; = T extends string ? true : false;&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;20. TypeScript Versioning and Compatibility&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;New Features&lt;/strong&gt;: Stay updated with new TypeScript versions, as it’s a rapidly evolving language. New features like template literal types, type predicates, and stricter type checking can improve your code.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;By mastering these TypeScript-specific concepts, you'll be able to leverage the full power of TypeScript, including its static type system, for improved code quality, maintainability, and scalability compared to plain JavaScript.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;want to know more about me, just write &lt;strong&gt;&lt;a href="//sallbro.com"&gt;sallbro&lt;/a&gt;&lt;/strong&gt; on search engine...&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>programming</category>
    </item>
    <item>
      <title>NIST Defination of cloud computing with Diagram</title>
      <dc:creator>Salman Asu</dc:creator>
      <pubDate>Sun, 01 Sep 2024 14:32:17 +0000</pubDate>
      <link>https://dev.to/sallbro/nist-defination-of-cloud-computing-with-diagram-2ph1</link>
      <guid>https://dev.to/sallbro/nist-defination-of-cloud-computing-with-diagram-2ph1</guid>
      <description>&lt;h2&gt;
  
  
  Defination:
&lt;/h2&gt;

&lt;p&gt;The National Institute of Standards and Technology (NIST) defines cloud computing as a model for enabling convenient, ondemand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftb6tp12cxj1uwwsq35f6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftb6tp12cxj1uwwsq35f6.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment Models:
&lt;/h2&gt;

&lt;p&gt;Cloud computing has revolutionized the way businesses operate, offering scalable resources and flexible solutions tailored to meet diverse needs. One of the critical aspects of cloud computing is understanding the different deployment models available. These models determine how cloud services are delivered and managed, each with unique benefits and trade-offs. In this article, we’ll delve into the primary cloud deployment models: Public Cloud, Private Cloud, Hybrid Cloud, and Multi-Cloud.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Private Cloud:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Overview&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A private cloud is a cloud environment dedicated to a single organization, either hosted on-premises or by a third-party provider. This model offers enhanced control over data, security, and compliance.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Key Features&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Enhanced Security: Dedicated infrastructure reduces the risk of data breaches.&lt;br&gt;
Customization: Tailored to meet specific business and regulatory requirements.&lt;br&gt;
Performance: Often provides better performance for certain workloads due to dedicated resources.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use Cases&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Large Enterprises: Require robust security and compliance for sensitive data.&lt;br&gt;
Financial Institutions: Need to comply with strict regulatory requirements.&lt;br&gt;
Healthcare Providers: Handle sensitive patient data securely.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pros and Cons&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pros: Greater control and security, customizable infrastructure, compliance benefits.&lt;br&gt;
Cons: Higher costs, requires in-house expertise to manage, less scalable compared to public cloud.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Community Cloud&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Overview&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A community cloud is a collaborative cloud infrastructure shared by several organizations with common goals or requirements. These organizations often belong to a specific community, such as healthcare, finance, or government, and share the infrastructure to address common concerns like security, compliance, and performance.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Key Features&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Shared Resources: Infrastructure is shared among organizations with similar needs, reducing costs.&lt;br&gt;
Compliance and Security: Tailored to meet the specific regulatory and security requirements of the community.&lt;br&gt;
Collaboration: Facilitates collaboration among community members, enabling shared projects and initiatives.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use Cases&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Healthcare Organizations: Share infrastructure for patient data management, ensuring compliance with health regulations.&lt;br&gt;
Financial Institutions: Collaborate on secure transaction processing and regulatory reporting.&lt;br&gt;
Government Agencies: Share resources for public administration and citizen services.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pros and Cons&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pros: Cost-effective, enhanced security and compliance, fosters collaboration.&lt;br&gt;
Cons: Limited scalability compared to public cloud, potential governance and management challenges, dependency on community agreements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Public Cloud&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Overview&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The public cloud is the most common deployment model, where cloud services are delivered over the internet by third-party providers. Examples include Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). These providers offer a range of services, from storage and computing power to advanced machine learning tools.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Key Features&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Scalability: Easily scale resources up or down based on demand.&lt;br&gt;
Cost-Effectiveness: Pay-as-you-go pricing models help reduce capital expenditure.&lt;br&gt;
Accessibility: Services are accessible from anywhere with an internet connection.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use Cases&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Startups and Small Businesses: Low upfront costs and scalability make it ideal for growing companies.&lt;br&gt;
Development and Testing: Rapid provisioning of resources for development environments.&lt;br&gt;
E-commerce Platforms: Handle variable traffic loads efficiently.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pros and Cons&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pros: High scalability, cost-effective, no maintenance overhead.&lt;br&gt;
Cons: Potential security and compliance concerns, less control over infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Hybrid Cloud&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Overview&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The hybrid cloud combines both public and private clouds, allowing data and applications to be shared between them. This model provides the flexibility of the public cloud with the security of the private cloud.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Key Features&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Flexibility: Workloads can be moved between public and private clouds based on needs.&lt;br&gt;
Cost Optimization: Utilize public cloud resources for non-sensitive tasks and private cloud for sensitive workloads.&lt;br&gt;
Disaster Recovery: Enhanced backup and recovery solutions by leveraging multiple environments.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use Cases&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Seasonal Workloads: Manage variable workloads by scaling out to the public cloud during peak times.&lt;br&gt;
Data Processing: Use private cloud for sensitive data and public cloud for large-scale data processing.&lt;br&gt;
Business Continuity: Implement disaster recovery solutions across both environments.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pros and Cons&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pros: Balanced cost and control, enhanced flexibility, improved disaster recovery.&lt;br&gt;
Cons: Complex to manage, potential compatibility issues, requires robust network connectivity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Delivery Models:
&lt;/h2&gt;

&lt;p&gt;Cloud computing has become an integral part of modern IT infrastructure, providing scalable, on-demand resources that drive innovation and efficiency. The way cloud services are delivered is categorized into several models, each serving different needs and applications. These delivery models are Infrastructure as a Service (IaaS), Platform as a Service (PaaS) and Software as a Service (SaaS).Understanding these models is crucial for businesses to make informed decisions and leverage the benefits of cloud computing effectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Infrastructure as a Service (IaaS)&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Overview&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;IaaS is the foundational layer of cloud services, providing virtualized computing resources over the internet. With IaaS, businesses can rent infrastructure such as servers, storage, and networking on a pay-as-you-go basis, eliminating the need for physical hardware.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Key Features&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Scalability: Easily scale resources up or down based on demand.&lt;br&gt;
Cost Efficiency: Reduce capital expenditure by paying only for what you use.&lt;br&gt;
Flexibility: Configure and manage infrastructure according to specific needs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use Cases&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Disaster Recovery: Implement cost-effective backup and recovery solutions.&lt;br&gt;
Development and Testing: Quickly provision and decommission environments for software development.&lt;br&gt;
Website Hosting: Host websites and web applications with flexible resource allocation.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pros and Cons&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pros: High scalability, cost-effective, flexible and customizable.&lt;br&gt;
Cons: Requires expertise to manage, potential security risks if not configured correctly.&lt;br&gt;
Examples&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amazon Web Services (AWS) EC2&lt;/li&gt;
&lt;li&gt;Microsoft Azure Virtual Machines&lt;/li&gt;
&lt;li&gt;Google Compute Engine (GCE)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Platform as a Service (PaaS)&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Overview&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;PaaS provides a platform allowing customers to develop, run, and manage applications without dealing with the underlying infrastructure. This model includes tools and services for application development, such as operating systems, databases, and development frameworks.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Key Features&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Development Tools: Integrated development environments (IDEs), version control, and testing services.&lt;br&gt;
Middleware: Support for application hosting, database management, and messaging services.&lt;br&gt;
Automation: Automated provisioning and scaling of resources.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use Cases&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Application Development: Streamline the development, testing, and deployment of applications.&lt;br&gt;
APIs and Microservices: Develop and manage APIs and microservices efficiently.&lt;br&gt;
Enterprise Applications: Build and deploy scalable enterprise applications without infrastructure concerns.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pros and Cons&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pros: Accelerates development, reduces management overhead, supports collaborative work.&lt;br&gt;
Cons: Less control over underlying infrastructure, potential vendor lock-in.&lt;br&gt;
Examples&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google App Engine&lt;/li&gt;
&lt;li&gt;Microsoft Azure App Services&lt;/li&gt;
&lt;li&gt;Heroku&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Software as a Service (SaaS)&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Overview&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;SaaS delivers software applications over the internet on a subscription basis. Users access software via a web browser, eliminating the need for installation and maintenance. This model is widely used for business applications, such as email, customer relationship management (CRM), and collaboration tools.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Key Features&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Accessibility: Access applications from any device with an internet connection.&lt;br&gt;
Maintenance: The provider handles software updates, security, and maintenance.&lt;br&gt;
Subscription-Based: Pay-as-you-go pricing with different subscription tiers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Use Cases&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Business Applications: Use applications like CRM, ERP, and office productivity tools.&lt;br&gt;
Collaboration Tools: Facilitate team collaboration with tools like Slack and Microsoft Teams.&lt;br&gt;
Customer Support: Implement customer support solutions like Zendesk.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pros and Cons&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Pros: Easy to use, reduces IT management burden, scalable.&lt;br&gt;
Cons: Limited customization, data security concerns, dependency on internet connectivity.&lt;br&gt;
Examples&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Salesforce&lt;/li&gt;
&lt;li&gt;Google Workspace&lt;/li&gt;
&lt;li&gt;Microsoft Office 365&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&amp;gt; Essential Characteristics:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;On-Demand Self-Service:&lt;/strong&gt; Users can provision computing resources as needed automatically, without requiring human interaction with each service’s provider.&lt;br&gt;
Ubiquitous Network Access: Services are accessible over the network via standard mechanisms, promoting use across a wide range of devices and platforms.&lt;br&gt;
&lt;strong&gt;Rapid Elasticity:&lt;/strong&gt; Resources can be quickly scaled up or down to meet demand, ensuring efficient utilization and responsiveness.&lt;br&gt;
Location-Independent Resource Pooling: Resources are pooled to serve multiple users, with different physical and virtual resources dynamically assigned and reassigned according to demand.&lt;br&gt;
&lt;strong&gt;Measured Service:&lt;/strong&gt; Cloud systems automatically control and optimize resource use by leveraging a metering capability, typically providing transparency for both the provider and consumer of the utilized service.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
