<?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>Forem: codebond</title>
    <description>The latest articles on Forem by codebond (@codebondco).</description>
    <link>https://forem.com/codebondco</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%2F283717%2Fd129b0e9-cceb-49d5-9ebe-aed2fef362b6.jpg</url>
      <title>Forem: codebond</title>
      <link>https://forem.com/codebondco</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/codebondco"/>
    <language>en</language>
    <item>
      <title>Can someone explain TypeScript to me like I'm 5 years old?</title>
      <dc:creator>codebond</dc:creator>
      <pubDate>Sun, 17 May 2020 18:10:00 +0000</pubDate>
      <link>https://forem.com/codebondco/can-someone-explain-typescript-to-me-like-i-m-5-years-old-37i4</link>
      <guid>https://forem.com/codebondco/can-someone-explain-typescript-to-me-like-i-m-5-years-old-37i4</guid>
      <description>&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--jYcUApZe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1126465131305676811/gVsSpleX_normal.jpg" alt="Kyle Shook⚡️ profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Kyle Shook⚡️
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="comment-mentioned-user" href="https://dev.to/elyktrix"&gt;@elyktrix&lt;/a&gt;

      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--52oNvK_0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-ff4bdab814039c4cb172a35ea369e0ea9c6a4b59b631a293896ae195fa26a99d.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Can someone explain TypeScript to me like I'm 5 years old?
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      00:03 AM - 07 May 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1258185759280050179" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1258185759280050179" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      279
      &lt;a href="https://twitter.com/intent/like?tweet_id=1258185759280050179" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      1625
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--5ru68QIs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1203546472429408256/uv-tP1Dq_normal.jpg" alt="Thomas Irizarry profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Thomas Irizarry
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @tommytomtj
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--52oNvK_0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-ff4bdab814039c4cb172a35ea369e0ea9c6a4b59b631a293896ae195fa26a99d.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      &lt;a href="https://twitter.com/elyktrix"&gt;@elyktrix&lt;/a&gt; If you say 'orange' TypeScript will ask if you mean the fruit or the color, JavaScript won't ask and you might end up drinking a glass of orange paint instead of orange juice.
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      02:51 AM - 07 May 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1258227927994384385" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1258227927994384385" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      157
      &lt;a href="https://twitter.com/intent/like?tweet_id=1258227927994384385" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      1197
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ElUT8NBU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/media/EXYOqgpUcAAJWIl.jpg" alt="unknown tweet media content"&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--JDpx_yGI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1067884626906046464/7KHMPlJe_normal.jpg" alt="ian h profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        ian h
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @ianhunter
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--52oNvK_0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-ff4bdab814039c4cb172a35ea369e0ea9c6a4b59b631a293896ae195fa26a99d.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      &lt;a href="https://twitter.com/elyktrix"&gt;@elyktrix&lt;/a&gt; Typescript is this toy. 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      01:37 AM - 07 May 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1258209274347638787" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1258209274347638787" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      13
      &lt;a href="https://twitter.com/intent/like?tweet_id=1258209274347638787" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      306
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wik-lwEt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1162975723411378176/apD7dVLv_normal.jpg" alt="Tommy Rocket profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Tommy Rocket
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="comment-mentioned-user" href="https://dev.to/tomhockett"&gt;@tomhockett&lt;/a&gt;

      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--52oNvK_0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-ff4bdab814039c4cb172a35ea369e0ea9c6a4b59b631a293896ae195fa26a99d.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      &lt;a href="https://twitter.com/elyktrix"&gt;@elyktrix&lt;/a&gt; TypeScript is like your teacher who yells at you a lot and you're not quite sure why until you listen to what they're saying.
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      01:40 AM - 07 May 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1258210154610376705" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1258210154610376705" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      6
      &lt;a href="https://twitter.com/intent/like?tweet_id=1258210154610376705" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      120
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media ltag__twitter-tweet__media__video-wrapper"&gt;
        &lt;div class="ltag__twitter-tweet__media--video-preview"&gt;
          &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CqwGPZtI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/tweet_video_thumb/EXYskCbXgAAi8o3.jpg" alt="unknown tweet media content"&gt;
          &lt;img src="/assets/play-butt.svg" class="ltag__twitter-tweet__play-butt" alt="Play butt"&gt;
        &lt;/div&gt;
        &lt;div class="ltag__twitter-tweet__video"&gt;
          
            
          
        &lt;/div&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s---_xrk8-5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1197733984291057664/d7Z0K7Nw_normal.jpg" alt="Tim Myers profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Tim Myers
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        &lt;a class="comment-mentioned-user" href="https://dev.to/denvercoder"&gt;@denvercoder&lt;/a&gt;

      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--52oNvK_0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-ff4bdab814039c4cb172a35ea369e0ea9c6a4b59b631a293896ae195fa26a99d.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      &lt;a href="https://twitter.com/elyktrix"&gt;@elyktrix&lt;/a&gt; JavaScript is like “go play outside”. Typescript is like “you can’t play outside until you clean your room”. 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      03:48 AM - 07 May 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1258242150166401025" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1258242150166401025" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      21
      &lt;a href="https://twitter.com/intent/like?tweet_id=1258242150166401025" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      220
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--I7KAqhXg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/948478068540272641/4S3VmbIn_normal.jpg" alt="Quarterstack developer profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Quarterstack developer
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @ocramius
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--52oNvK_0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-ff4bdab814039c4cb172a35ea369e0ea9c6a4b59b631a293896ae195fa26a99d.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      &lt;a href="https://twitter.com/elyktrix"&gt;@elyktrix&lt;/a&gt; &lt;a href="https://twitter.com/Jan0707"&gt;@Jan0707&lt;/a&gt; Like driving a train, except that in JavaScript you are off-road, and in TypeScript you have rails.
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      10:21 AM - 07 May 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1258341119387107330" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1258341119387107330" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      5
      &lt;a href="https://twitter.com/intent/like?tweet_id=1258341119387107330" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      73
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--hzauo249--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1245854220353404929/IqOOJdWk_normal.jpg" alt="Amilcar Calles profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Amilcar Calles
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @amilcarcalles
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--52oNvK_0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-ff4bdab814039c4cb172a35ea369e0ea9c6a4b59b631a293896ae195fa26a99d.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      &lt;a href="https://twitter.com/elyktrix"&gt;@elyktrix&lt;/a&gt; I will say to my son: typescript is like when we study math together at home, I’m there to help you if you make some mistake (I’m TypeScript), JavaScript well, JavaScript is your final exam, you complete the writing, then you wait the result without knowing if something was wrong
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      02:20 AM - 07 May 2020
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1258220194608054272" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1258220194608054272" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      1
      &lt;a href="https://twitter.com/intent/like?tweet_id=1258220194608054272" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      4
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;h4&gt;
  
  
  How will you explain? But should be unique.
&lt;/h4&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>discuss</category>
      <category>beginners</category>
    </item>
    <item>
      <title>
Implementation of a Graph -JavaScript</title>
      <dc:creator>codebond</dc:creator>
      <pubDate>Sun, 10 May 2020 09:39:46 +0000</pubDate>
      <link>https://forem.com/codebondco/implementation-of-a-graph-javascript-4jin</link>
      <guid>https://forem.com/codebondco/implementation-of-a-graph-javascript-4jin</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In previous tutorials, we learned some &lt;a href="https://codebond.co/tutorial/javascript/introduction-to-graph-data-structure"&gt;basics of a graph&lt;/a&gt;, it's &lt;a href="https://codebond.co/tutorial/javascript/graph-representation"&gt;representation&lt;/a&gt;, and it's &lt;a href="https://codebond.co/tutorial/javascript/introduction-to-graph-data-structure#applicationofgraph"&gt;application&lt;/a&gt;. In this tutorial, we are going to practically implement our previous knowledge and learn to create an undirected graph.&lt;/p&gt;

&lt;p&gt;pre-requisite: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://codebond.co/tutorial/javascript/introduction-to-graph-data-structure"&gt;Basics of graph theory&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codebond.co/tutorial/javascript/graph-representation"&gt;Graph representation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes"&gt;classes in JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map"&gt;Map()&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Graph {
  constructor(){
      this.nodes = new Map()
  }
  addNode(){}
  addEdge(){}
  removeNode(){}
  removeEdge(){}
  depthfirstSearch(){}
  breadthFirstSearch(){}
  display(){}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above snippet shows the steps and method takes to create a graph. as we go further, we will get to see the implementation and pseudo-code.&lt;/p&gt;

&lt;p&gt;let's start&lt;/p&gt;
&lt;h2&gt;
  
  
  this.nodes
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--T_cZI-RH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/iy66elzpzdyev2nfvspk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--T_cZI-RH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/iy66elzpzdyev2nfvspk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;this.nodes&lt;/code&gt; is an Object in which &lt;code&gt;key&lt;/code&gt; holds the node and &lt;code&gt;value&lt;/code&gt; hold an array of adjacent nodes.&lt;/p&gt;

&lt;p&gt;initially, it is empty.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.nodes = {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  addNode(node)
&lt;/h2&gt;

&lt;p&gt;It adds a new node to the graph.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;addNode(node){
 this.nodes.set(node,[])
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;the array of adjacent nodes is initially set to be empty because the new node does not have any edge yet.&lt;/p&gt;
&lt;h2&gt;
  
  
  addEdge(source,destination)
&lt;/h2&gt;

&lt;p&gt;It adds an edge between &lt;code&gt;source&lt;/code&gt; node and &lt;code&gt;destination&lt;/code&gt; node.&lt;/p&gt;

&lt;p&gt;In order to add an edge, we need the adjacency list of the &lt;code&gt;source&lt;/code&gt; node then push &lt;code&gt;destination&lt;/code&gt; node to it. since it is an undirected graph, we also need to push the &lt;code&gt;source&lt;/code&gt; node to the adjacency list of &lt;code&gt;destination&lt;/code&gt; node.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;addEdge(source,destination){
  this.nodes.get(source).push(destination)
  this.nodes.get(destination).push(source)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;let's implement what we learn so far.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@SaudChougle/implementationofgraph01?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  removeNode(node)
&lt;/h2&gt;

&lt;p&gt;It basically removes the node from the graph.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lNvLjUu4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9g3d5q40sqh1syvi4zey.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lNvLjUu4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9g3d5q40sqh1syvi4zey.png" alt="alt text"&gt;&lt;/a&gt;&lt;br&gt;
But, in order to remove a node, we must first remove the edges that are associated with the removal node.&lt;/p&gt;

&lt;p&gt;In the above example. to remove node "D" we first have to remove the edges that are associated with "D" which are "D-A" and "D-B" after that we can remove the "D".&lt;/p&gt;

&lt;p&gt;In the following code, we added a helper function &lt;code&gt;getIndexAndRemoveItem(item,list)&lt;/code&gt; it takes argument &lt;code&gt;item&lt;/code&gt; as node (that we are going to remove) and &lt;code&gt;list&lt;/code&gt; as an array (from which we are going to remove item).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; removeNode(node) {
        let neighbors = this.nodes.get(node);

        for(let neighbor of neighbors){
            let adjacencyListOfNeighbor = this.nodes.get(neighbor);
            this.getIndexAndRemoveItem(node, adjacencyListOfNeighbor);
        }

        this.nodes.delete(node);
 }

 getIndexAndRemoveItem(item, list) {
        const index = list.indexOf(item);
        list.splice(index, 1);
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Checkout the  👉 &lt;a href="https://res.cloudinary.com/codebond/image/upload/v1588917700/e49zqvgphmlcfutpojhr.png"&gt;pseudocode&lt;/a&gt; for &lt;code&gt;removeNode()&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  removeEdge(source,destination)
&lt;/h2&gt;

&lt;p&gt;It removes the edge between &lt;code&gt;source&lt;/code&gt; node and &lt;code&gt;destination&lt;/code&gt; node.&lt;/p&gt;

&lt;p&gt;To remove the edge, we must have all the nodes that share an edge with &lt;code&gt;source&lt;/code&gt; node in a simple term adjacency list of the source node. since it is an undirected graph, we need an adjacency list of &lt;code&gt;destination&lt;/code&gt; node as well.&lt;/p&gt;

&lt;p&gt;Then, with the help of our helper function &lt;code&gt;getIndexAndRemoveItem()&lt;/code&gt; we can remove the edge.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;removeEdge(source, destination) {
        let adjacencyListOfSource = this.nodes.get(source);
        let adjacencyListOfDestination = this.nodes.get(destination);

        this.getIndexAndRemoveItem(source, adjacencyListOfDestination);
        this.getIndexAndRemoveItem(destination, adjacencyListOfSource);
}

getIndexAndRemoveItem(item, list) {
        const index = list.indexOf(item);
        list.splice(index, 1);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Checkout the 👉 &lt;a href="https://res.cloudinary.com/codebond/image/upload/v1588913399/utfcgpwocj4i8rmwhrco.png"&gt;pseudocode&lt;/a&gt; for &lt;code&gt;removeEdge()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;let's implement&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@SaudChougle/implementationofgraph02?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  depthFirstSearch(startingNode)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1BifiqXT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/db3yl4z5b84ix31yacmz.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1BifiqXT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/db3yl4z5b84ix31yacmz.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;depth-first-search is a traversal technique in which we go as deep as possible in the graph once we reach a node where we cannot further go down, we backtrack to the node we came from. This process repeated until we explore all other nodes in the graph.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;depthFirstSearch(startingNode) {
   let visitedNode = [];
   this.dfsRecursion(startingNode, visitedNode);
}
dfsRecursion(currentNode, visitedNode) {
   visitedNode[currentNode] = true;

   console.log(currentNode);

   let adjacencyListOfCurrentNode = this.nodes.get(currentNode);

   for (var node of adjacencyListOfCurrentNode) {
       if (!visitedNode[node]) this.dfsRecursion(node, visitedNode);
   }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;checkout the 👉 &lt;a href="https://res.cloudinary.com/codebond/image/upload/v1588928313/k8vspkzjmcdj4oeghdm8.png"&gt;pseudocode&lt;/a&gt; for &lt;code&gt;depthFirstSearch()&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  breadthFirstSearch(startingNode)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4ff8vqeP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6h49zsazxpuaz41mhlax.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4ff8vqeP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6h49zsazxpuaz41mhlax.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Unlike depth-first-search, where we go deep before exploring neighbors, in breadth-first-search, we explore all the neighbors of a node before moving a level down.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;breadthFirstSearch(startingNode) {
     let visitedNode = [];
     let queue = [];

     visitedNode[startingNode] = true;
     queue.push(startingNode);

     while (queue.length &amp;gt; 0) {
         const currentNode = queue.shift();

         console.log(currentNode);

         const adjacencyListOfCurrentNode = this.nodes.get(currentNode);

         for (let node of adjacencyListOfCurrentNode) {
             if (!visitedNode[node]) {
                 visitedNode[node] = true;
                 queue.push(node);
             }
         }
     }
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;checkout the 👉 &lt;a href=""&gt;pseudocode&lt;/a&gt; for &lt;code&gt;breadthFirstSearch()&lt;/code&gt;&lt;/p&gt;


&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@SaudChougle/implementationofgraph03?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;We learned to create and manipulate a graph by adding, removing nodes and edges. we also covered the depth-first-search and breadth-first-search algorithm.&lt;br&gt;
Soon in the next posts, we will see the more efficient and professional way to create a graph.&lt;/p&gt;

&lt;h3&gt;
  
  
  Thank for reading 🙏
&lt;/h3&gt;

&lt;p&gt;Was this article helpful? don't forget to share because Sharing is Caring.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reference
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://adrianmejia.com/data-structures-for-beginners-graphs-time-complexity-tutorial/"&gt;Adrian Mejia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/implementation-graph-javascript/"&gt;geeksforgeeks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/Chougle-saud/79cbdf22d7686e853b1eb17c24b3057a"&gt;Github Gist&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>datastructure</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Graph Representation</title>
      <dc:creator>codebond</dc:creator>
      <pubDate>Thu, 30 Apr 2020 04:10:18 +0000</pubDate>
      <link>https://forem.com/codebondco/graph-representation-1nmg</link>
      <guid>https://forem.com/codebondco/graph-representation-1nmg</guid>
      <description>&lt;p&gt;In &lt;a href="https://dev.to/codebondco/introduction-to-graph-data-structure-59l4"&gt;Introduction To Graph Data Structure&lt;/a&gt;, we learned&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://codebond.co/tutorial/javascript/introduction-to-graph-data-structure#whatisagraphdatastructure?"&gt;What is a Graph data structure?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codebond.co/tutorial/javascript/introduction-to-graph-data-structure#graphterminologies"&gt;Graph Terminologies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codebond.co/tutorial/javascript/introduction-to-graph-data-structure#typesofgraph"&gt;Types of graph&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=""&gt;Application Of Graph&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this tutorial, we gonna see two common and recommended ways to represent a graph.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adjacency matrix&lt;/li&gt;
&lt;li&gt;Adjacency List&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--On8gY2OL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/codebond/image/upload/v1587284296/adkwzuuiz3mfwmsqt66v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--On8gY2OL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/codebond/image/upload/v1587284296/adkwzuuiz3mfwmsqt66v.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If i asked what are &lt;a href="https://codebond.co/tutorial/javascript/introduction-to-graph-data-structure#graphterminologies"&gt;adjacent&lt;/a&gt; node of node "A"? you will find all neighbors connected to node "A" by just looking at the graph.&lt;/p&gt;

&lt;p&gt;But the question is how the computer will understand the graph and adjacent of node "A" 🤔???&lt;/p&gt;

&lt;p&gt;Well, bear with me, we will make sure that computer understands the graph.&lt;/p&gt;

&lt;h1&gt;
  
  
  Adjacency Matrix
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ieto_9rC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/codebond/image/upload/v1587283050/vpzbq82fgipgb1fj7chp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ieto_9rC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/codebond/image/upload/v1587283050/vpzbq82fgipgb1fj7chp.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An adjacency matrix is a 2-dimensional array of size N x N where N is the number of the node.&lt;/p&gt;

&lt;p&gt;let 2-dimensional array be adj[ i ][ j ] .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;adj[ i ][ j ] = 1 means there is edge between node "i" and "j".

adj[ i ][ j ] = 0 means there no edge between node "i" and "j".

lets understand by above example:

adj[ 0 ][ 0 ] = 0 (edge between node 0 and 0)

adj[ 0 ][ 1 ] = 1 (edge between node 0 and 1)

adj[ 0 ][ 2 ] = 0 (no edge between node 0 and 2)

adj[ 0 ][ 3 ] = 1 (edge between node 0 and 3)

adj[ 0 ][ 4 ] = 1 (edge between node 0 and 4)

adj[ 0 ][ 5 ] = 0 (no edge between node 0 and 5)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;similarly for other node....&lt;/p&gt;
&lt;h2&gt;
  
  
  Representation of graph by Adjacency Matrix: javascript
&lt;/h2&gt;
&lt;h3&gt;
  
  
  initialize()
&lt;/h3&gt;

&lt;p&gt;It creates a 2-dimensional array and sets the adjmatrix[row][coloumn] to 0 which means there is no edge between any node.&lt;/p&gt;
&lt;h3&gt;
  
  
  addEdge()
&lt;/h3&gt;

&lt;p&gt;It creates an edge between source and destination and destination and source.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@SaudChougle/Adjacency-Matrix?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;



&lt;h1&gt;
  
  
  Adjacency List
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iwjbazUX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/codebond/image/upload/v1587282716/ertqa2dhmhmv9nmyku3d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iwjbazUX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/codebond/image/upload/v1587282716/ertqa2dhmhmv9nmyku3d.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In graph theory and computer science, an adjacency list is a collection of unordered lists used to represent a finite graph. Each list describes the set of neighbors of a vertex in the graph. __Wikipedia&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In simple words&lt;br&gt;
In Adjacency List each Node will have a list(array) of his adjacent(neighbor) nodes.&lt;/p&gt;
&lt;h2&gt;
  
  
  Representation of graph by Adjacency List: javascript
&lt;/h2&gt;
&lt;h3&gt;
  
  
  addNode()
&lt;/h3&gt;

&lt;p&gt;It creates a new node with an empty list.&lt;/p&gt;
&lt;h3&gt;
  
  
  addEdge()
&lt;/h3&gt;

&lt;p&gt;It creates an edge between source and destination by pushing the destination node to the list of the source.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__replit"&gt;
  &lt;iframe height="550px" src="https://repl.it/@SaudChougle/Adjacency-List?lite=true"&gt;&lt;/iframe&gt;
&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;This post first published on &lt;a href="https://codebond.co/tutorial/javascript/graph-representation"&gt;codebond&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>datastructure</category>
      <category>graph</category>
    </item>
    <item>
      <title>Clean Code Principles - Function</title>
      <dc:creator>codebond</dc:creator>
      <pubDate>Tue, 14 Apr 2020 10:33:17 +0000</pubDate>
      <link>https://forem.com/codebondco/clean-code-principles-function-52hb</link>
      <guid>https://forem.com/codebondco/clean-code-principles-function-52hb</guid>
      <description>&lt;p&gt;I am reading a book Clean Code by Robert C. Martin and It is amazing so far. some principles he made need to be highlighted.&lt;/p&gt;

&lt;p&gt;I am thinking of sharing other principles too as I go ahead in reading. because it will help me and you to learn and implement.&lt;/p&gt;

&lt;p&gt;In this post, i covered &lt;strong&gt;clean code principles for functions&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;1&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Function should do one thing. They should do it well. They should do it only.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;2&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If a function does only those steps that are one level below the stated name of the function, then the function is doing one thing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;3&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The smaller and more focus a function is, the easier it is to choose a descriptive name.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;4&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Another way to know that a function is doing more than "one thing" is if you can extract another function from it with a name that is not merely a restatement of its implementation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;5&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A long descriptive name is better than a long descriptive comment.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;6&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The ideal number of arguments for a function is zero (niladic). Next comes one (monadic), followed closely by two (dyadic). Three arguments (triadic) should be avoided where possible. More than three (polyadic) requires very special justification-- and they shouldn't be used anyway.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;7&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Function should either do something or answer something, but not both. either your function should change the state of an object, or it should return some information about that object. doing both often leads to confusion.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Happy coding.
&lt;/h3&gt;

&lt;p&gt;This post first published on &lt;a href="https://codebond.co/@codebond.cb/clean-code-principles-function"&gt;codebond.co&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>python</category>
      <category>java</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Introduction To Graph Data Structure</title>
      <dc:creator>codebond</dc:creator>
      <pubDate>Tue, 31 Mar 2020 18:13:20 +0000</pubDate>
      <link>https://forem.com/codebondco/introduction-to-graph-data-structure-59l4</link>
      <guid>https://forem.com/codebondco/introduction-to-graph-data-structure-59l4</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w2mTr3HL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/33a4t97gxx5968vhdzrt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w2mTr3HL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/33a4t97gxx5968vhdzrt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  What is a Graph data structure?
&lt;/h1&gt;

&lt;p&gt;A Graph is a collection of vertices/nodes and edges in a way that vertices/nodes are connected by an edge.&lt;/p&gt;

&lt;h1&gt;
  
  
  Graph Terminologies
&lt;/h1&gt;

&lt;p&gt;fig01&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7D-P3Lxx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uny1y5yzwe27cpnlli5t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7D-P3Lxx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/uny1y5yzwe27cpnlli5t.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Vertex or Node
&lt;/h2&gt;

&lt;p&gt;Every individual point that holds or represents some kind of data is called vertex or node. &lt;/p&gt;

&lt;p&gt;In fig01 points "A", "B", "C", "D", "E" are vertex/node since there multiple vertex/node so it called vertices/nodes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;nodes and vertices both terms are the same.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Edge
&lt;/h2&gt;

&lt;p&gt;A connection between two nodes is called an edge. In fig01 the connection between node B and node E is edge similarly A-B, A-C, A-C, A-D, B-D, C-D, D-E are edges.&lt;/p&gt;

&lt;h1&gt;
  
  
  Adjacent
&lt;/h1&gt;

&lt;p&gt;fig02&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wed8RGZu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9cczdp544o403ydjg2x1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wed8RGZu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9cczdp544o403ydjg2x1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This terminology often used with vertices/nodes.&lt;/p&gt;

&lt;p&gt;Adjacent node shares a common edge. &lt;/p&gt;

&lt;p&gt;let me explain you.&lt;/p&gt;

&lt;p&gt;In fig02 nodes B, D, C shares a common edge with node "A" and similarly with others too.&lt;/p&gt;

&lt;p&gt;Now if i ask you what are adjacents nodes of "A" that means all the nodes that share common edges with node "A".&lt;/p&gt;

&lt;p&gt;Adjacent of all nodes&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Nodes&lt;/th&gt;
&lt;th&gt;Adjacents&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;BDC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;ADE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;AD&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;D&lt;/td&gt;
&lt;td&gt;CABE&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;E&lt;/td&gt;
&lt;td&gt;BD&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  Degree
&lt;/h1&gt;

&lt;p&gt;fig03&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pnCeihve--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/q0ou49hezv0javcltn98.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pnCeihve--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/q0ou49hezv0javcltn98.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The degree is the number of edges connected to a node. &lt;br&gt;
for example, the node "D" has a degree of 4 while the "E"  has a degree of 2.&lt;/p&gt;

&lt;h1&gt;
  
  
  Types of graph
&lt;/h1&gt;

&lt;p&gt;fig04&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9uFX5E3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pm6c3clylaop6oxfu478.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y9uFX5E3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pm6c3clylaop6oxfu478.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  disconnected graph
&lt;/h2&gt;

&lt;p&gt;In a disconnected graph, not all nodes have edges. nodes might be isolated.&lt;/p&gt;

&lt;p&gt;if you see the above disconnected graph, there are three isolated regions. in simple words, these three regions don't have a connection between them. &lt;/p&gt;

&lt;h2&gt;
  
  
  connected graph
&lt;/h2&gt;

&lt;p&gt;a graph is connected if all nodes have at least one edge.&lt;/p&gt;

&lt;h2&gt;
  
  
  undirected graph
&lt;/h2&gt;

&lt;p&gt;an undirected graph has no direction. The edges indicate a two-way relationship, in that each edge can be traversed in both directions.&lt;/p&gt;

&lt;h2&gt;
  
  
  directed graph
&lt;/h2&gt;

&lt;p&gt;a directed graph has edges with direction. The edges indicate a one-way relationship, in that each edge can only be traversed in a single direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  complete graph
&lt;/h2&gt;

&lt;p&gt;A graph is said to be complete if each node have a degree of n-1(n = total nodes)&lt;/p&gt;

&lt;p&gt;sound like mathematics&lt;/p&gt;

&lt;p&gt;in simple words&lt;/p&gt;

&lt;p&gt;A graph is said to be complete if each node has an edge with all other nodes except itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  cyclic graph
&lt;/h2&gt;

&lt;p&gt;A graph can have cycles which means that if you traverse through the node, you could get the same node more than once.&lt;/p&gt;

&lt;h2&gt;
  
  
  acyclic graph
&lt;/h2&gt;

&lt;p&gt;a graph is acyclic that means the graph must have at least one node with no targets (called a leaf).&lt;/p&gt;

&lt;p&gt;in the above image, the orange node doesn't have any outgoing edge.&lt;/p&gt;

&lt;h1&gt;
  
  
  Applications Of Graph
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Social media like Facebook, LinkedIn uses graphs that store users, groups, check-ins, likes and more as nodes.&lt;/li&gt;
&lt;li&gt;Google Maps, Apple Maps, Waze use graphs to treat all cities and places as nodes and routes between them as edges.&lt;/li&gt;
&lt;li&gt;Webgraph describes a directed graph between pages of the WWW. Each page is a vertex and the hyperlinks are edges. This is the basic idea behind the Google Page Ranking Algorithm.&lt;/li&gt;
&lt;li&gt;Uber, Ola, Lyft uses a graph to find the shortest and cheapest path for a car from one city to another. &lt;/li&gt;
&lt;li&gt;The graph also used in a database for representing Entity-Relationship.&lt;/li&gt;
&lt;li&gt;Graph theory also used to study molecules in chemistry and physics.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  reference
&lt;/h3&gt;

&lt;p&gt;this tutorial first published on &lt;a href="https://codebond.co/tutorial/javascript/introduction-to-graph-data-structure"&gt;codebond.co&lt;/a&gt;&lt;/p&gt;

</description>
      <category>datastructure</category>
      <category>javascript</category>
      <category>python</category>
      <category>java</category>
    </item>
    <item>
      <title>How to build and publish npm package.</title>
      <dc:creator>codebond</dc:creator>
      <pubDate>Wed, 26 Feb 2020 13:35:01 +0000</pubDate>
      <link>https://forem.com/codebondco/how-to-build-and-publish-npm-package-1mdi</link>
      <guid>https://forem.com/codebondco/how-to-build-and-publish-npm-package-1mdi</guid>
      <description>&lt;p&gt;I recently published an article (tutorial) &lt;strong&gt;How to build and publish npm package&lt;/strong&gt; on &lt;a href="//codebond.co"&gt;codebond&lt;/a&gt; in which I visually covered all the steps required to publish and update npm package. &lt;/p&gt;

&lt;p&gt;Checkout full article &lt;a href="https://codebond.co/tutorial/nodejs/how-to-build-and-publish-npm-package"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Build
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OOJKeyn9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/704mp06ezdx7de1h473j.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OOJKeyn9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/704mp06ezdx7de1h473j.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Publish
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RpoqNPnJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xmb3epraayw6tib7lyj4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RpoqNPnJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xmb3epraayw6tib7lyj4.gif" alt="Alt Text"&gt;&lt;/a&gt; &lt;/p&gt;

</description>
      <category>npm</category>
      <category>node</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Gitex - Git Command Explorer</title>
      <dc:creator>codebond</dc:creator>
      <pubDate>Thu, 20 Feb 2020 08:00:28 +0000</pubDate>
      <link>https://forem.com/codebondco/gitex-git-command-explorer-50dn</link>
      <guid>https://forem.com/codebondco/gitex-git-command-explorer-50dn</guid>
      <description>&lt;h2&gt;
  
  
  What is gitex?
&lt;/h2&gt;

&lt;p&gt;Gitex is &lt;strong&gt;Git Command Explorer&lt;/strong&gt;. It helps to find Git Command right in your terminal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why did i build?
&lt;/h2&gt;


&lt;div class="ltag__user ltag__user__id__5259"&gt;
  
    .ltag__user__id__5259 .follow-action-button {
      background-color: #1C0BBA !important;
      color: #FFFFFF !important;
      border-color: #1C0BBA !important;
    }
  
    &lt;a href="/addyosmani" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E-h3UrGx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--VWra6P3Y--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/5259/2f2afc8a-b9ae-4138-9fec-2622eb06eb37.jpg" alt="addyosmani image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/addyosmani"&gt;Addy Osmani&lt;/a&gt;
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/addyosmani"&gt;My name is Addy and I’m an engineering manager on the Chrome team. Let's make the web fast &amp;lt;3&lt;/a&gt;
    &lt;/div&gt;
    &lt;p class="ltag__user__social"&gt;
        &lt;a href="https://twitter.com/addyosmani" rel="noopener"&gt;
          &lt;img class="icon-img" alt="twitter logo" src="https://res.cloudinary.com/practicaldev/image/fetch/s--oEHrSmvE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-logo.svg"&gt;addyosmani
        &lt;/a&gt;
        &lt;a href="https://github.com/addyosmani" rel="noopener"&gt;
          &lt;img class="icon-img" alt="github logo" src="https://res.cloudinary.com/practicaldev/image/fetch/s--C74Jn3f1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo.svg"&gt;addyosmani
        &lt;/a&gt;
        &lt;a href="https://addyosmani.com" rel="noopener"&gt;
          &lt;img class="icon-img" alt="external link icon" src="https://res.cloudinary.com/practicaldev/image/fetch/s--WsHTbjfA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/link.svg"&gt;https://addyosmani.com
        &lt;/a&gt;
    &lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
 Addy Osmani recently shared an amazing tool &lt;a href="https://gitexplorer.com"&gt;git explorer&lt;/a&gt; which i found helpful i thought it would be great if i make cli of this because at the end git command used in terminal.
&lt;h2&gt;
  
  
  How to install
&lt;/h2&gt;

&lt;p&gt;for Linux and mac&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo npm install gitex -g
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;for window&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install gitex -g
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  start
&lt;/h2&gt;

&lt;p&gt;run &lt;code&gt;gitex&lt;/code&gt; in terminal&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1OGaYnp8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5xh6qqgo2j5itx2z25xf.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1OGaYnp8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5xh6qqgo2j5itx2z25xf.gif" alt="Gitex"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>gitex</category>
      <category>gitexplorer</category>
    </item>
    <item>
      <title>hi i am new in dev community</title>
      <dc:creator>codebond</dc:creator>
      <pubDate>Fri, 13 Dec 2019 07:10:59 +0000</pubDate>
      <link>https://forem.com/codebondco/hi-i-am-new-in-dev-community-i5j</link>
      <guid>https://forem.com/codebondco/hi-i-am-new-in-dev-community-i5j</guid>
      <description>

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