<?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: Sankalpcreat</title>
    <description>The latest articles on DEV Community by Sankalpcreat (@sankalpcreat).</description>
    <link>https://dev.to/sankalpcreat</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%2F1099671%2Fafd815b9-b1ce-47f9-8ed9-da784839599e.jpeg</url>
      <title>DEV Community: Sankalpcreat</title>
      <link>https://dev.to/sankalpcreat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sankalpcreat"/>
    <language>en</language>
    <item>
      <title>Redux State Management Library</title>
      <dc:creator>Sankalpcreat</dc:creator>
      <pubDate>Tue, 12 Sep 2023 05:21:26 +0000</pubDate>
      <link>https://dev.to/sankalpcreat/redux-state-management-library-4591</link>
      <guid>https://dev.to/sankalpcreat/redux-state-management-library-4591</guid>
      <description>&lt;p&gt;First of All thanks to &lt;a href="https://overreacted.io/" rel="noopener noreferrer"&gt;Dan Abramov&lt;/a&gt; for creating Redux which is wonderful for state management as well as UI/UX binding which enhances App performance.&lt;/p&gt;

&lt;p&gt;Why redux? what is that makes redux better in case of normal react application.&lt;/p&gt;

&lt;p&gt;Without Redux each components of state management handles the user input and manages its own state.some time it share with props with other that rely on data change.But here comes a difference if there are only components having parent child relationship with the state management components then funda is clear logic is clear about that no issue because its simple hierarchy model which is present child and parent relationship.&lt;/p&gt;

&lt;p&gt;Know here comes the catch which is when these state management has to share data with other many components in the applications through it then there is one problem that come into account that is &lt;strong&gt;Props drilling&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Prop drilling&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;here in above image i have show how prop drilling works initially we have 3 function loginpage.js,Dashboard.js,profile.js&lt;br&gt;
We know that loginpage is parent of both in prop-drilling parent transfers its data to child and child transfer its  data to its child due to this process if the application is large enough then this hierarchy model will fail.&lt;/p&gt;

&lt;p&gt;How redux handles its data flow due to large and complex structure of application &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfq88bxt7at5ikcou570.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnfq88bxt7at5ikcou570.gif" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is gif in above example how it handles the complex data flow model threw it.&lt;br&gt;
How from state it goes to UI and then after UI structure &lt;br&gt;
in this UI first it will go to the event handler for this it has to do some even task which is deposit.From Eventhandler it will dispatch the Action which contain the key and data in from of map gies to store this is cyclic process which handles the data flow control. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Redux vs Redux-Tool kit</title>
      <dc:creator>Sankalpcreat</dc:creator>
      <pubDate>Wed, 16 Aug 2023 03:47:31 +0000</pubDate>
      <link>https://dev.to/sankalpcreat/redux-vs-redux-tool-kit-41pn</link>
      <guid>https://dev.to/sankalpcreat/redux-vs-redux-tool-kit-41pn</guid>
      <description>&lt;p&gt;As we know in recent time how react is growing popularity in Tech Industry.Today we will be discussing about redux and its tool kit how ,when,where to use and differences how redux-tool kit helps redux to enhance the Application.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Redux?
&lt;/h2&gt;

&lt;p&gt;Redux is react popular state management library that handles state change thanks to Dan abramov for redux that makes our job easier and simpler to manage the state change.&lt;br&gt;
Redux follow the Flux architecture and also follows centralized storage management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Redux ToolKit
&lt;/h2&gt;

&lt;p&gt;Redux toolkit is simplified package that helps the Redux flow.&lt;br&gt;
Redux has lot of boilerplate code while writing Like define actions,writing the reducer.&lt;/p&gt;

&lt;p&gt;Lets see the difference  in code base when we use redux and when we use redux tool kit .Let take an example for counter using redux&lt;/p&gt;

&lt;h2&gt;
  
  
  Counter Using Redux
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Increment='Increment'
const Decrement='Decrement'

const increment= () =&amp;gt;({type:Increment })
const decrement = () =&amp;gt;({type:Decrement})

const counterReducer = (state=0,action) =&amp;gt;{
switch(action.type){
case Increment:
  return state+1;
case Decrement:
  return state-1;
default:
return state;}
);
const {createStore}=Redux;
const store=creatStore(counterReducer);

store.dispatch(increment());
console.log(store.getState());

store.dispatch(decrement());
console.log(store.getState());

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Counter Using Redux-ToolKit
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import {createSlice,configureStore} from '@reduxjs/toolkit'
const counterSlice=createSlice({
name:'counter',
intialState:'0',
reducer:(
increment:(state)=&amp;gt;state+1,
decrement:(state)=&amp;gt;state-1,
},
});
const store=configureStore({reducer:counterSlice.reducer});
store.dispatch(counterSlice.action.increment());
console.log(store.getState());

store.dispatch(counterSlice.action.decrement());
console.log(store.getState());
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the above notation code we can get to know the boilerplate code for redux when we have to initialize the state management but in redux toolkit we have in-build library of redux&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of Redux-ToolKit
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Reduce boilerplate code&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Immutability Handling&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Devtools Integration&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  When to use Redux
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Advance use cases-&lt;/strong&gt; In case if you are using Middleware,custom enhancer,manual control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Existing Redux codebase-&lt;/strong&gt; we can use redux if code base is already existing because shifting of codebase makes problematic.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>redux</category>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Next js next boom in 2023</title>
      <dc:creator>Sankalpcreat</dc:creator>
      <pubDate>Sat, 29 Jul 2023 05:32:09 +0000</pubDate>
      <link>https://dev.to/sankalpcreat/next-js-next-boom-in-2023-52il</link>
      <guid>https://dev.to/sankalpcreat/next-js-next-boom-in-2023-52il</guid>
      <description>&lt;p&gt;Next js is getting more popular day by day as it get more Server Side rendering in coming 2023 year .As technology growing more users are using &lt;strong&gt;Mobile Web&lt;/strong&gt; which is gaining more popularity in industry&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6d26nkoxmrv9hxr7zugj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6d26nkoxmrv9hxr7zugj.png" alt="Image description" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
One more thing We can use Reactjs with Next-Js  as next js is javascript &lt;strong&gt;open-source&lt;/strong&gt; framework  .After this scene Nextjs growing more popularity than reactjs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Next-js is Reactjs_&lt;/strong&gt; Framework which is growing day by day&lt;/p&gt;

&lt;p&gt;Everybody will have question that Why NEXT JS if we have react js already &lt;br&gt;
the answer to that is NEXT JS has some special In build function which helps to enhance Server Side Rendering and statical generation of web-pages .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvw9o8e134ye4xnwb5kc6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvw9o8e134ye4xnwb5kc6.png" alt="Image description" width="800" height="815"&gt;&lt;/a&gt;&lt;br&gt;
Why Developer are loving NEXT-JS &lt;/p&gt;

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

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Typescript support&lt;/strong&gt;-We know that typescript is better than vanilla Javascript because it in typescript error can be easily handle.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovnlrxwqgxthr6j93w05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovnlrxwqgxthr6j93w05.png" alt="Image description" width="371" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;SSR(SERVER SIDE RENDERING)&lt;/strong&gt; server side rendering is becoming better day by day as refresh rate is increasing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnn8pithhn205mlai2qxy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnn8pithhn205mlai2qxy.png" alt="Image description" width="300" height="168"&gt;&lt;/a&gt;&lt;br&gt;
3.**Code Spitting **As we know in 2019 we use webpack and rollup for code spitting but know next js is used which will manage codespitting .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8f3uib6pswxgev486ea5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8f3uib6pswxgev486ea5.png" alt="Image description" width="800" height="308"&gt;&lt;/a&gt;&lt;br&gt;
4.&lt;strong&gt;Create React-app&lt;/strong&gt; -Dan abramov I am really sorry about Create-react-app how hard work you have done in building this feature now next js has come to replace because it cause lot of error.Now your facebook team also replace that with next js official documentation.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Typescript advance Concept</title>
      <dc:creator>Sankalpcreat</dc:creator>
      <pubDate>Sat, 22 Jul 2023 05:55:07 +0000</pubDate>
      <link>https://dev.to/sankalpcreat/typescript-advance-concept-3o5p</link>
      <guid>https://dev.to/sankalpcreat/typescript-advance-concept-3o5p</guid>
      <description>&lt;p&gt;In this Blog we will be understanding some advance concept of typescript how union ,tuples and intersection generics and all other work in typescript &lt;br&gt;
These are the special usage that make typescript better than Javascript as they can be reused again and again &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1f9acoeggk7ga5uuv886.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1f9acoeggk7ga5uuv886.jpg" alt="Union" width="800" height="444"&gt;&lt;/a&gt;&lt;br&gt;
Firstly I will be discussing about is Union in typescript.Often sometime when you do building  your project there is always some kind of doubt that what this function going to return and is this is a  Sting ,number or undefined to solve this problem we use union it is  denoted by symbol &lt;strong&gt;|&lt;/strong&gt;  this helps you to see the return type of the function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const person =(name:string|NULL)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here above code satisfy that name can be either  a string or a NULL value with help of this we are not sure whether to give a string or NULL value so we start usage of Union which helps us to solve the doubt about that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqpfqbxbs23dbfyz2iu3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqpfqbxbs23dbfyz2iu3.jpg" alt="Tuples" width="800" height="444"&gt;&lt;/a&gt;&lt;br&gt;
Next topic which we are going to brief about is tuples .Tuples plays an import role when we have to give lot of types for the given data like if we want to give data in bulk then we need to define an array which store the value for the types they return .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var data:[string,number];
data=['Jack',3];
data=['Mick',5];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here above code snipped we can see that there is data variable which has return type of string and number these are again and again used for the string value like jack mick .One thing that we need to keep in mind that order of types should be same that if you have given string first you have to give string first at the time of calling that type&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc0wgkzach62jhulgthnu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc0wgkzach62jhulgthnu.png" alt="Generics" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
Here generics plays a very vital role when there is defined all kind of function It can be initialize like &lt;strong&gt;&amp;lt;&amp;gt;&lt;/strong&gt; these to bracket any type inside the bracket&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const inti=&amp;lt;T&amp;gt;(arg:T) =&amp;gt;{
return arg;}

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

&lt;/div&gt;



&lt;p&gt;above code base here we use generics which use generics of type T can be any either string,number etc that typescript compiler can detect by itself so return arg can return any things like string,number,boolean depending upon the case passed&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How Typescript differ from Javascript</title>
      <dc:creator>Sankalpcreat</dc:creator>
      <pubDate>Mon, 17 Jul 2023 10:17:26 +0000</pubDate>
      <link>https://dev.to/sankalpcreat/how-typescript-differ-from-javascript-265c</link>
      <guid>https://dev.to/sankalpcreat/how-typescript-differ-from-javascript-265c</guid>
      <description>&lt;p&gt;In this small section we will be exploring typescript advantages over javascript how it can be used for the better development purpose.&lt;br&gt;
&lt;strong&gt;Types&lt;/strong&gt; Mostly Typescript contains some special keyword like &lt;strong&gt;Number,String,Boolean&lt;/strong&gt; but some are very import as they might cause an lot of bug in code like &lt;strong&gt;Any and Never&lt;/strong&gt; these two keyword makes hell if you don't use  them carefully many developer face problem with any and never keyword as Typescript is Type defined language so to be precises we have to used these data carefully what they are return value etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Javascript :
let value=32134;
Typescript 
let value:number=32134;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Disclaimer not to use any&lt;/em&gt;&lt;br&gt;
let us take an example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let hero 

function gethero(){
return "gfg";
hero=gethero()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In above example typescript will automatically detect the return type and it will show us &lt;strong&gt;any&lt;/strong&gt; this means no type is define so by default it will take any as type so this value can be changed if any keyword is define it can be boolean ,number ,string any thing this may create a havoc in your code so be careful while using any keyword  in your code.&lt;/p&gt;

&lt;p&gt;In the next section we will learn about how to use typescript in your defined function lets say&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function data(email:string){
 email.toUpperCase();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let us take the above example in that we have taken a function which will take parameter as email  and that to is defined as string that is new thing that we have introduced in Typescript,which was not in javascript&lt;br&gt;
&lt;strong&gt;If you want to return type of function&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;function data(email:string):boolean{
return true;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we have defined the return type of function data which has return type of boolean so it will return the true and false value&lt;/p&gt;

&lt;p&gt;In this section we will be learning &lt;strong&gt;Interface&lt;/strong&gt; how to use? where to use? when to use ?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface User{
name:string;
id:number;
above18:boolean
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this is an interface defining to use the and define various data and the object inside it with single name if User which can be further used&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const value:User{
name:"bet",
id:52,
above18;true,
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the way how to use interface with the object value by use of previous data&lt;/p&gt;

&lt;p&gt;There is lot of discussion in the Tech industry that where to use &lt;strong&gt;interface vs type&lt;/strong&gt;&lt;br&gt;
We can use both of them but there is problem if you want to add more data in type it will give error but on the other side interface it will not give you error.That means interface can be extended&lt;/p&gt;

&lt;p&gt;One more major Advantage of type over interface is that it can be used as &lt;strong&gt;union,tuples and primitive&lt;/strong&gt; this section will be covered in next blog &lt;/p&gt;

&lt;p&gt;Now here comes the important points where to use interface and where to use types &lt;br&gt;
Interface&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if new object need to bed defined
Type&lt;/li&gt;
&lt;li&gt;When your need is to define tuples,primitive and union&lt;/li&gt;
&lt;li&gt;if you are using map type function to take the value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;some important topics like Generics,tuples,primitive usage of typescript in abstract class  &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>development</category>
    </item>
    <item>
      <title>Bellman ford algorithm</title>
      <dc:creator>Sankalpcreat</dc:creator>
      <pubDate>Tue, 20 Jun 2023 09:33:20 +0000</pubDate>
      <link>https://dev.to/sankalpcreat/bellman-ford-algorithm-m9e</link>
      <guid>https://dev.to/sankalpcreat/bellman-ford-algorithm-m9e</guid>
      <description>&lt;p&gt;Bellman ford algorithm mainly used to find the shortest path in graph but today i will try to implement with real world example some of other algorithm like*&lt;em&gt;Dijkstra Algorithm&lt;/em&gt;* which is also use to find the shortest path but some limitation are there in Dijkstra Algorithm like it fails when there is &lt;strong&gt;directed graph&lt;/strong&gt; , &lt;strong&gt;edges is negative&lt;/strong&gt; to make sure Bellman ford algorithm works completely fine &lt;/p&gt;

&lt;p&gt;Let us take a daily life example suppose you went to hill station and you chose a elevation feature in your map now from going up to down it will show negative value so here dijkstra fails to find the shortest path&lt;/p&gt;

&lt;p&gt;Let us take an example for this &lt;/p&gt;

&lt;p&gt;I have taken an directed 6 location A,B,C,D,E,F and there weight(distance) is negative  as well as positive so to find the minimum distance bellman ford algorithm&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fel1n54oxswq3a9e03js8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fel1n54oxswq3a9e03js8.png" alt="Image description" width="730" height="718"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now from above picture we are clear with the edges and the path of destination and source as well as weight(distance) &lt;/p&gt;

&lt;p&gt;For calculating the  shortest path there is formula for it&lt;br&gt;
but first we have to create a distance vector and mark source A as 0 and other as ∞(infinity) because we don't know the exact distance(weight) &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkmfgbiu1vjt15l54h6j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmkmfgbiu1vjt15l54h6j.png" alt="Image description" width="423" height="326"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now after taking distance array we need to write formula for it and iterate upto &lt;strong&gt;N-1&lt;/strong&gt; N(represent edges) times that is difference between the bellman ford and dijkstra algorithm formula for both the algorithm  is same but that N-1 iteration makes a difference between both&lt;br&gt;
formula for  Bellman ford algorithm is&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpm1avllhhcnd0og2od3o.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpm1avllhhcnd0og2od3o.jpg" alt="Image description" width="800" height="736"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;to use this formula first make a table of source destination and distance between two&lt;/p&gt;

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

&lt;p&gt;after forming these two table do the first iteration and change the distance array from  infinity to the value you will see that after first iteration B-5 ,C-3,D-6,E-3,F-2&lt;br&gt;
then after second iteration distance are changed&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F340zyckn0k0rwsidz1vy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F340zyckn0k0rwsidz1vy.png" alt="Image description" width="349" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;after N-1 iteration the answer for the distance array will be&lt;br&gt;
&lt;strong&gt;A-0,B-5,C-3,D-1,E-3,F-2&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JavaScript Deprecated list</title>
      <dc:creator>Sankalpcreat</dc:creator>
      <pubDate>Fri, 16 Jun 2023 14:35:13 +0000</pubDate>
      <link>https://dev.to/sankalpcreat/javascript-deprecated-list-1f51</link>
      <guid>https://dev.to/sankalpcreat/javascript-deprecated-list-1f51</guid>
      <description>&lt;p&gt;As we know how javascript is evolving day by day new library  are coming every year but mostly 3 library/framework are dominating the dev community. React ,Vue , Angular Javascript most popular libraries/framework. Deprecation typically occurs for various reasons, such as improving language consistency, enhancing performance, or addressing security concerns. When a feature is deprecated, it means that it is still available for use, but developers are encouraged to migrate to the recommended alternatives to ensure compatibility with future versions of the language.&lt;/p&gt;

&lt;p&gt;1-Deprecated String functions: The &lt;strong&gt;String.prototype.anchor()&lt;/strong&gt;, &lt;strong&gt;String.prototype.big()&lt;/strong&gt;, &lt;strong&gt;String.prototype.blink()&lt;/strong&gt;, &lt;strong&gt;String.prototype.small()&lt;/strong&gt;, &lt;strong&gt;String.prototype.strike()&lt;/strong&gt;, and &lt;strong&gt;String.prototype.sup()&lt;/strong&gt; methods are deprecated&lt;/p&gt;

&lt;p&gt;2-Deprecated Function properties:The Function.prototype.arguments and Function.prototype.caller properties are deprecated&lt;/p&gt;

&lt;p&gt;3-Deprecated Function constructor:Using &lt;strong&gt;eval()&lt;/strong&gt; with untrusted code can lead to code injection vulnerabilities.&lt;/p&gt;

&lt;p&gt;4-Deprecated &lt;strong&gt;escape()&lt;/strong&gt; and &lt;strong&gt;unescape()&lt;/strong&gt; functions: recommended to use &lt;strong&gt;encodeURI()&lt;/strong&gt;, &lt;strong&gt;encodeURIComponent()&lt;/strong&gt;, &lt;strong&gt;decodeURI()&lt;/strong&gt;, and **decodeURIComponent() **functions instead.&lt;/p&gt;

&lt;p&gt;eval() Function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Previous
eval('console.log("Hello, World!")');


//New way

console.log("Hello, World!");

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

&lt;/div&gt;



&lt;p&gt;Function Constructor:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//Previous
var multiply = new Function('a', 'b', 'return a * b;');


//Modern way
var multiply = (a, b) =&amp;gt; a * b;

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

&lt;/div&gt;



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