<?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: katongole Isaac</title>
    <description>The latest articles on DEV Community by katongole Isaac (@katongole_isaac).</description>
    <link>https://dev.to/katongole_isaac</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%2F811641%2Fd0b0b238-40a6-457d-aae1-e81a0302b6b4.png</url>
      <title>DEV Community: katongole Isaac</title>
      <link>https://dev.to/katongole_isaac</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/katongole_isaac"/>
    <language>en</language>
    <item>
      <title>Arrays and Linked Lists</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Fri, 07 Mar 2025 18:32:29 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/arrays-and-linked-lists-2kgc</link>
      <guid>https://dev.to/katongole_isaac/arrays-and-linked-lists-2kgc</guid>
      <description>&lt;h3&gt;
  
  
  Arrays
&lt;/h3&gt;

&lt;p&gt;An array is a data structure that stores elements contiguously. This makes them a good fit for reading operations because they offer random access. Forexample It takes &lt;code&gt;O(1)&lt;/code&gt; contanst time to get an element anywhere in the array since we know it's address. But when it comes to insertions, arrays tend to be slower, reason being adding new elements to an array means to also shift existing elements. Therefore this takes &lt;code&gt;O(n)&lt;/code&gt; time to insert an element into an array.&lt;/p&gt;

&lt;h3&gt;
  
  
  Linked Lists
&lt;/h3&gt;

&lt;p&gt;For linked lists, elements are not stored contiguously, elements are stored at different memory locations but they are chained in a way to form a linked list. Forexample first element store the address of the next element which in turn store the address of the next element and so on...&lt;br&gt;&lt;br&gt;
Linked lists are faster for insertion operations &lt;code&gt;O(1)&lt;/code&gt;, all you need to do is insert an element in memory and get the last element point to the address of the recent added element. For reading operations &lt;code&gt;O(n)&lt;/code&gt;, linked lists are slower since we only know the address of the first element,we need to go through every element reading the addresses they point to.   &lt;/p&gt;

&lt;h3&gt;
  
  
  Comparison Arrays and Linked lists
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Array&lt;/th&gt;
&lt;th&gt;Linked list&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Insertion&lt;/td&gt;
&lt;td&gt;&lt;code&gt;O(n)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;O(1)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Reading&lt;/td&gt;
&lt;td&gt;&lt;code&gt;O(1)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;O(n)&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
    </item>
    <item>
      <title>Simple Markdown-Based Blogging Platform</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Wed, 19 Feb 2025 13:41:47 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/simple-markdown-based-blogging-platform-4k72</link>
      <guid>https://dev.to/katongole_isaac/simple-markdown-based-blogging-platform-4k72</guid>
      <description>&lt;p&gt;Hey everyone! 👋&lt;/p&gt;

&lt;p&gt;I’ve always wanted to make it easier for people to own a modern blog without needing to write a single line of code. So, I built this project that lets you publish blog posts just by writing in Markdown—it handles the rest! 🚀&lt;/p&gt;

&lt;p&gt;✨ Features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Write your posts in Markdown, and they’ll be published automatically.&lt;/li&gt;
&lt;li&gt;No need for a database—just focus on writing!&lt;/li&gt;
&lt;li&gt;Fast, lightweight, and easy to set up.&lt;/li&gt;
&lt;li&gt;Includes a CLI tool to help with setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re interested, check it out here: &lt;a href="https://github.com/katongole-isaac/blog" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt; 🔥&lt;/p&gt;

&lt;p&gt;For demo video &lt;a href="https://www.loom.com/share/c26bc79c799b4ecf92cbb6e01299fae8?sid=b1519e0a-e3b4-4309-9844-7578eb2d2412" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’d love to hear your thoughts—feedback, feature suggestions, or just say hi! 😃&lt;/p&gt;

</description>
      <category>programming</category>
      <category>nextjs</category>
      <category>tailwindcss</category>
      <category>webdev</category>
    </item>
    <item>
      <title>React Video Game Hub</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Mon, 27 Nov 2023 10:36:36 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/react-video-game-hub-236d</link>
      <guid>https://dev.to/katongole_isaac/react-video-game-hub-236d</guid>
      <description>&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%2Fk3a8bkj0rux1uxezelan.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%2Fk3a8bkj0rux1uxezelan.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Built a video game Hub&lt;br&gt;
Demo Link : &lt;a href="https://games-ashen-eight.vercel.app/" rel="noopener noreferrer"&gt;live demo&lt;/a&gt;&lt;br&gt;
Source Code: &lt;a href="https://github.com/katongole-isaac/games" rel="noopener noreferrer"&gt;github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API integration&lt;/li&gt;
&lt;li&gt;Sorting &amp;amp; Filtering&lt;/li&gt;
&lt;li&gt;Searching&lt;/li&gt;
&lt;li&gt;Image Optimization&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to contact me if there is any fullstack developer role.&lt;/p&gt;

&lt;p&gt;LinkedIn: &lt;a href="https://www.linkedin.com/in/katongole-isaac/" rel="noopener noreferrer"&gt;Isaac&lt;/a&gt;&lt;/p&gt;

</description>
      <category>reactjsdevelopment</category>
      <category>react</category>
      <category>typescript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Good News</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Mon, 06 Nov 2023 10:16:20 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/good-news-4bgn</link>
      <guid>https://dev.to/katongole_isaac/good-news-4bgn</guid>
      <description>&lt;p&gt;I'm am available on upwork to be hired. &lt;/p&gt;

&lt;p&gt;Dear clients,&lt;br&gt;
I'm a fullstack developer with expertise in reactjs and Nodejs for building SaaS apps as well as websites and apps.&lt;/p&gt;

&lt;p&gt;If you're in search for such skills, please support me on upwork.&lt;/p&gt;

&lt;p&gt;Link: &lt;a href="https://www.upwork.com/workwith/katongolei" rel="noopener noreferrer"&gt;katongole isaac on Upwork&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for considering me for your freelancing work.&lt;/p&gt;

&lt;p&gt;Isaac&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Problems I face as a freelancer on Upwork</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Fri, 16 Jun 2023 07:05:09 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/problems-i-face-as-a-freelancer-on-upwork-2j1p</link>
      <guid>https://dev.to/katongole_isaac/problems-i-face-as-a-freelancer-on-upwork-2j1p</guid>
      <description>&lt;p&gt;Hi guys, I hope you're doing well. I would like to share some of my experience and also some questions i still have as a freelancer. &lt;/p&gt;

&lt;p&gt;I started freelancing at the beginning of this year as of 2023 both on upwork and fiverr. So far 6 months have elapsed but not good results yet on both sides. &lt;br&gt;
One thing I've noticed is that its hard for new-comers like myself to get at-least one gig a week or even a month. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Guys, am i doing things the way they are supposed to be ?&lt;/strong&gt;&lt;br&gt;
I truly don't understand why am i failing to make it. &lt;/p&gt;

&lt;p&gt;Nowadays its hard for me on upwork, you find a gig with over 50+ proposals sent but unfortunately the client instead invites totally different people to take up that gig, so in the end people who sent their proposals actually wasted all the connects.&lt;/p&gt;

&lt;p&gt;Maybe I'm talking from one side, I would like to hear from the those ones who have made it through freelancing so that I also learn or follow their practices.&lt;/p&gt;

&lt;p&gt;To be honest &lt;strong&gt;freelancing is also a problem on its own&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I look forward to hearing from successful freelancers from anywhere around the world.&lt;/p&gt;

&lt;p&gt;Best regards&lt;br&gt;
Isaac Katongole&lt;br&gt;
Frontend Developer&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Nextjs Dashboard</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Mon, 12 Jun 2023 16:36:12 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/nextjs-dashboard-3pd8</link>
      <guid>https://dev.to/katongole_isaac/nextjs-dashboard-3pd8</guid>
      <description>&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%2Faju1wosyy1tu5qjkkkeo.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%2Faju1wosyy1tu5qjkkkeo.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hello guys,&lt;br&gt;
I developed a simple dashboard project using Nextjs and bootstrap. &lt;/p&gt;

&lt;p&gt;Project Link: &lt;a href="https://nextjs-dashboard-7dvy0m0ha-katongole-isaac.vercel.app/" rel="noopener noreferrer"&gt;Live demo&lt;/a&gt;&lt;br&gt;
source code: &lt;a href="https://github.com/katongole-isaac/nextjs-dashboard" rel="noopener noreferrer"&gt;github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I learnt&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nextjs Basics

&lt;ul&gt;
&lt;li&gt;SSR, SSG and Client-side rendering.&lt;/li&gt;
&lt;li&gt;Routing i.e static and dyanmic routes.&lt;/li&gt;
&lt;li&gt;Adding static assets i.e css and image files.&lt;/li&gt;
&lt;li&gt;Project structuring&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Integration and Consuming 3rd party RESTFUL APIs&lt;/li&gt;

&lt;li&gt;Concepts suchas Client pagination, sorting , filtering&lt;/li&gt;

&lt;li&gt;Implementing drag and drop features&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Author&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/katongole-isaac-7a22aa178/" rel="noopener noreferrer"&gt;Isaac Katongole&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I look forward to hearing from you.&lt;br&gt;
Thanks&lt;/p&gt;

&lt;p&gt;Best regards&lt;br&gt;
Isaac | Frontend developer&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>My portfolio</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Sat, 20 May 2023 17:03:41 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/my-portfolio-4ghd</link>
      <guid>https://dev.to/katongole_isaac/my-portfolio-4ghd</guid>
      <description>&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%2F3rsyjkuxlv3mkvyxf2tp.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%2F3rsyjkuxlv3mkvyxf2tp.png" alt="Image description" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
Hey guys, I do have a sample portfolio site that i would like to share with you.&lt;br&gt;
Currently, I am working on more projects so that can add them to that site. &lt;br&gt;
Please feel free to take a visit.&lt;br&gt;
Here is the link: &lt;a href="https://katongoleisaac.netlify.app/" rel="noopener noreferrer"&gt;katongole.isaac&lt;/a&gt;&lt;br&gt;
I would like to recieve your feedback&lt;br&gt;
Thanks.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>React reusable components</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Fri, 19 May 2023 17:22:34 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/react-reusable-components-1ef3</link>
      <guid>https://dev.to/katongole_isaac/react-reusable-components-1ef3</guid>
      <description>&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%2F18bm0amzem9cvobwjsdc.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%2F18bm0amzem9cvobwjsdc.png" alt="Image description" width="800" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When creating components, its better to fully optimize reactjs library for its use ( &lt;em&gt;re-usability&lt;/em&gt; ).&lt;br&gt;&lt;br&gt;
Here are some key concepts to achieve resuability&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Generalize your components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create components that are loosely coupled from the concept you are trying to achieve. for example when creating a form, its better to create one input component that serves many purposes. i.e&lt;br&gt;
&lt;/p&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;  &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;rest&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; 
        &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;e&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;onChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
        &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;{...&lt;/span&gt;&lt;span class="nx"&gt;rest&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Raise events and don't pass handlers directly.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Its better for a component to determine how it deals its data given either via props or state. To maintain and achieve re-usability, its better to avoid passing down handlers but raise events.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With this line of code, &lt;code&gt;onChange= {e =&amp;gt; onChange(e)}&lt;/code&gt; the consumer of the &lt;code&gt;Input Component&lt;/code&gt; can pass whatever kind of handler he/she wants therefore giving you more freedom on your code.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Learning Nodejs the right way.</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Thu, 18 May 2023 17:42:32 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/learning-nodejs-the-right-way-40p0</link>
      <guid>https://dev.to/katongole_isaac/learning-nodejs-the-right-way-40p0</guid>
      <description>&lt;p&gt;Hey guys&lt;br&gt;
I created a page on &lt;a href="https://www.buymeacoffee.com/codewithisaac/" rel="noopener noreferrer"&gt;buymeacoffee&lt;/a&gt;, you can have a look at it &lt;a href="https://www.buymeacoffee.com/codewithisaac/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;br&gt;
Checkout my article about the common mistakes made when learning Nodejs&lt;br&gt;
Link: &lt;a href="https://www.buymeacoffee.com/codewithisaac/the-mistake-i-learning-nodejs" rel="noopener noreferrer"&gt;Learning Nodejs the right way.&lt;/a&gt;&lt;br&gt;
Thanks&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Calculator</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Wed, 04 Jan 2023 16:33:22 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/calculator-18f7</link>
      <guid>https://dev.to/katongole_isaac/calculator-18f7</guid>
      <description>&lt;p&gt;Hey guys, you can try my new calculator app. I built it using react.&lt;br&gt;
you can find it here 👉🏽 &lt;a href="https://katongole-isaac.github.io/calculator/" rel="noopener noreferrer"&gt;calculator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The source code is available here 👉🏽 &lt;a href="https://github.com/katongole-isaac/calculator/tree/master" rel="noopener noreferrer"&gt;source code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will be glad to hear from you guys. Nice time.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>html</category>
      <category>css</category>
    </item>
    <item>
      <title>Validate the order of parenthese in an expression</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Tue, 03 Jan 2023 13:21:04 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/validate-the-order-of-parenthese-in-an-expressions-2hj7</link>
      <guid>https://dev.to/katongole_isaac/validate-the-order-of-parenthese-in-an-expressions-2hj7</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;I wrote this logic when i was developing a simple calculator. My aim was to validate the order of parenthese in an expression.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;Please you can go through it and help me identify some bugs in it&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here is the implementation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;brackets&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="cm"&gt;/**
 * validates the order of parenthese in a string
 * @param {*} type string 
 * @returns boolean otherwise `throws an error`
 */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;checkSyntax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;//check if both of the brackets dont exists&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;brackets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;brackets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// check if one of the brackets exists.&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;brackets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;brackets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;brackets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;brackets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="s2"&gt;`Syntax error: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;&lt;span class="s2"&gt; at index &lt;/span&gt;&lt;span class="p"&gt;${[&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;//check if ) is at index 0  or ( is a last index throw otherwise skip&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;brackets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;brackets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Error ==&amp;gt; index &lt;/span&gt;&lt;span class="p"&gt;${[&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;//Here we now check for validity&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;stack&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;brackets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
      &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;brackets&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

      &lt;span class="c1"&gt;//if we are trying to pop an empty stack []&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Error : not in order &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

      &lt;span class="nx"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

      &lt;span class="c1"&gt;//if the stack is not empty and i is on the last iteration then throw otherwise skip&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
          &lt;span class="s2"&gt;`Syntax Error : stack is not empty i.e stack length = [&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;]`&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;

      &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;checkSyntax&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;((()))()()()&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;//true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>A simple JavaScript Challenge</title>
      <dc:creator>katongole Isaac</dc:creator>
      <pubDate>Mon, 21 Nov 2022 13:01:09 +0000</pubDate>
      <link>https://dev.to/katongole_isaac/a-simple-javascript-challenge-5752</link>
      <guid>https://dev.to/katongole_isaac/a-simple-javascript-challenge-5752</guid>
      <description>&lt;p&gt;Greetings gang, I did an assesment on a certain platform and i came across this simple question.&lt;/p&gt;

&lt;h4&gt;
  
  
  What would be its output?
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;num1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;num2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;num2&lt;/span&gt; &lt;span class="o"&gt;*=&lt;/span&gt; &lt;span class="nx"&gt;num1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;num2&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;num2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;num1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
