<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shahin Kahangi on Medium]]></title>
        <description><![CDATA[Stories by Shahin Kahangi on Medium]]></description>
        <link>https://medium.com/@shahin.kahangi?source=rss-e4029ebc27a4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cbTxrUZXkk0TQ3PwlHYayA@2x.jpeg</url>
            <title>Stories by Shahin Kahangi on Medium</title>
            <link>https://medium.com/@shahin.kahangi?source=rss-e4029ebc27a4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 28 May 2026 03:03:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shahin.kahangi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[JavaScript Array Methods Explained with Emojis ]]></title>
            <link>https://medium.com/@shahin.kahangi/javascript-array-methods-explained-with-emojis-65df415787e5?source=rss-e4029ebc27a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/65df415787e5</guid>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript-array-methods]]></category>
            <category><![CDATA[learn-to-code]]></category>
            <category><![CDATA[javascript-arrays]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Shahin Kahangi]]></dc:creator>
            <pubDate>Sun, 11 Feb 2024 12:03:27 GMT</pubDate>
            <atom:updated>2024-02-11T12:03:27.562Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DdWAzkFNbd9jnFPKHQdA8g.png" /></figure><p>Learning JavaScript array methods doesn’t have to be dull! Let’s dive into the most commonly used array methods with the help of some friendly emojis. Whether you’re a beginner or just need a quick refresher, this guide is for you!</p><h3>1. push() - Add to the End 🍔 ➕</h3><p>Explanation: Adds a new item to the end of an array.</p><p>Example:</p><pre>Initial: [🍕, 🍟]<br>.push(🍔)<br>After: [🍕, 🍟, 🍔]</pre><h3>2. pop() - Remove from the End 🍔 ➖</h3><p>Explanation: Removes the last item from an array.</p><p>Example:</p><pre>Initial: [🍕, 🍟, 🍔]<br>.pop()<br>After: [🍕, 🍟]</pre><h3>3. shift() - Remove from the Start 🔑 ➖</h3><p>Explanation: Removes the first item from an array.</p><p>Example:</p><pre>Initial: [🍔, 🍕, 🍟]<br>.shift()<br>After: [🍕, 🍟]</pre><h3>4. unshift() - Add to the Start 🔑 ➕</h3><p>Explanation: Adds a new item to the beginning of an array.</p><p>Example:</p><pre>Initial: [🍕, 🍟]<br>.unshift(🍔)<br>After: [🍔, 🍕, 🍟]</pre><h3>5. find() - Find an Item 🔍</h3><p>Explanation: Returns the first item that satisfies a provided testing function.</p><p>Example:</p><pre>[🍕, 🍟, 🍔, 🥗].find(item =&gt; item === 🍔)<br>Result: 🍔</pre><h3>6. filter() - Filter Items 🔠 🔄</h3><p>Explanation: Creates a new array with all items that pass the test implemented by the provided function.</p><p>Example:</p><pre>[🍕, 🍟, 🍔, 🥗].filter(item =&gt; item !== 🍕)<br>Result: [🍟, 🍔, 🥗]</pre><h3>7. map() - Transform Items 🔄</h3><p>Explanation: Creates a new array with the results of calling a provided function on every item in the calling array.</p><p>Example:</p><pre>[🍕, 🍟].map(item =&gt; item + &quot;🧀&quot;)<br>Result: [🍕🧀, 🍟🧀]</pre><h3>8. reduce() - Reduce to a Single Value 🔽</h3><p>Explanation: Applies a function against an accumulator and each element in the array (from left to right) to reduce it to a single value.</p><p>Example:</p><pre>[1️⃣, 2️⃣, 3️⃣, 4️⃣].reduce((total, num) =&gt; total + num)<br>Result: 🔟</pre><h3>9. forEach() - Perform Action on Each Item 🔄 🎬</h3><p>Explanation: Executes a provided function once for each array element. Example:</p><pre>[🍕, 🍟, 🍔].forEach(item =&gt; console.log(item))<br>Logs: 🍕🍟🍔</pre><h3>10. slice() - Select a Section ✂️</h3><p>Explanation: Returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included).</p><p>Example:</p><pre>[🍔, 🍕, 🍟, 🥗].slice(1, 3)<br>Result: [🍕, 🍟]</pre><h3>Conclusion</h3><p>With these emoji-filled examples, you’ve got a colorful guide to JavaScript’s most essential array methods. Whether you’re manipulating data or just hungry for knowledge (and possibly pizza), these methods are the building blocks for any aspiring JavaScript developer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65df415787e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Understanding Front-End and Back-End Development: A Simple Guide for Everyone ️]]></title>
            <link>https://medium.com/@shahin.kahangi/understanding-front-end-and-back-end-development-a-simple-guide-for-everyone-%EF%B8%8F-0c59aa5e751e?source=rss-e4029ebc27a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/0c59aa5e751e</guid>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Shahin Kahangi]]></dc:creator>
            <pubDate>Thu, 18 Jan 2024 10:04:47 GMT</pubDate>
            <atom:updated>2024-01-18T10:04:47.675Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*esPugYyY9VcDeLDwaMShfA.png" /><figcaption>Front-End and Back-End Development</figcaption></figure><p>Hey Medium readers! Today, let’s unravel the mystery of web development in a way that’s easy for everyone to grasp. Whether you’re a budding developer, a curious entrepreneur, or just a tech enthusiast, this guide is for you!</p><h3>🔵 Front-End Development: The Visible Web</h3><p>Front-End Development is like the stage of a theater — it’s what the audience sees and interacts with. It’s all about creating a visually appealing and intuitive user interface. Front-End developers are the artists and architects of the web, focusing on design, layout, and ensuring that a website is engaging and accessible to everyone. They work with tools like HTML, CSS, and JavaScript to bring websites to life.</p><p>Key aspects:</p><ul><li>Design and Layout: Crafting the look and feel of a website.</li><li>User Experience: Making sure the site is easy and enjoyable to use.</li><li>Performance: Ensuring the site loads quickly and runs smoothly.</li></ul><h3>🟢 Back-End Development: The Hidden Mechanics</h3><p>Back-End Development is like the backstage crew in a theater. It’s less visible to the audience but is crucial for the performance. This is where the data, servers, and application logic live. Back-End developers are the problem solvers who manage data exchange, server-side logic, database management, and application security. They work with server-side languages like Python, Ruby, and PHP, and manage databases using systems like MySQL and MongoDB.</p><p>Key aspects:</p><ul><li>Data Management: Handling the storage and retrieval of data.</li><li>Server Logic: Powering the functionality of a website.</li><li>Security: Protecting the website and its data from threats.</li></ul><h3>🤝 The Collaboration: Creating Harmonious Websites</h3><p>The magic of a great website lies in the seamless integration of Front-End and Back-End development. It’s a collaborative dance where both play vital roles. The Front-End is what users see and interact with, while the Back-End is what operates in the shadows to make everything work. Together, they create websites that are not only beautiful but also powerful and efficient.</p><h3>🚀 Your Journey in Web Development</h3><p>Whether you’re drawn to the creative aspects of Front-End or the technical challenges of Back-End, there’s a place for you in the world of web development. Maybe you’ll find that you enjoy both! The field is ever-evolving and offers endless opportunities for learning and growth.</p><p>So, what’s your take? Are you inclined towards the artistic side of Front-End, the technical prowess of Back-End, or intrigued by both? Share your thoughts and let’s embark on this web development journey together! 💬</p><p>#WebDevelopment #FrontEnd #BackEnd #TechExplained #MediumBlog</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0c59aa5e751e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Decoding JavaScript Timers: setTimeout vs setInterval]]></title>
            <link>https://medium.com/@shahin.kahangi/decoding-javascript-timers-settimeout-vs-setinterval-4f29b5ae2d9f?source=rss-e4029ebc27a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f29b5ae2d9f</guid>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Shahin Kahangi]]></dc:creator>
            <pubDate>Sat, 02 Dec 2023 08:16:08 GMT</pubDate>
            <atom:updated>2023-12-02T08:16:08.814Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="setTimeout and setInterval" src="https://cdn-images-1.medium.com/max/1024/1*0zQLZ58p1yk5IafqSVCLZw.png" /><figcaption>setTimeout and setInterval</figcaption></figure><p>JavaScript, the language that powers the web, is full of intriguing features, and its asynchronous nature is one of them. Among its many tools, setTimeout and setInterval are two functions that manage time in interesting ways. Let&#39;s dive into what makes these functions tick.</p><h3>What is setTimeout?</h3><p>setTimeout is a JavaScript function that allows you to execute a piece of code after a specified delay. It&#39;s like setting a timer after which your code gets the green light to run.</p><h4>Syntax</h4><pre>setTimeout(function, delay);</pre><ul><li>function: The code that you want to execute after the delay.</li><li>delay: The time (in milliseconds) to wait before running the code.</li></ul><h3>How Does It Work?</h3><p>Imagine you want to display a message to your website visitors, but only after they’ve been on your page for a certain amount of time. setTimeout is perfect for this.</p><h4>Example</h4><pre>setTimeout(() =&gt; {<br>  alert(&quot;Welcome to my website!&quot;);<br>}, 3000);</pre><p>This code will pop an alert saying “Welcome to my website!” after 3 seconds.</p><h3>What is setInterval?</h3><p>While setTimeout is like a one-time alarm clock, setInterval is like a repeating alarm. It lets you run a function repeatedly, at specific intervals.</p><h4>Syntax</h4><pre>setInterval(function, interval);</pre><ul><li>function: The function to execute.</li><li>interval: The time (in milliseconds) between each function call.</li></ul><h3>How Does It Work?</h3><p>setInterval is ideal when you need to update something regularly on your website. Think of a live clock or a countdown timer.</p><h4>Example</h4><pre>setInterval(() =&gt; {<br>  console.log(&quot;This message logs every 2 seconds&quot;);<br>}, 2000);</pre><p>This code logs a message to the console every 2 seconds.</p><h3>Differences at a Glance</h3><ul><li>Execution: setTimeout runs once after a delay. setInterval runs repeatedly at regular intervals.</li><li>Use Case: Use setTimeout for delayed execution. Use setInterval for continuous execution at fixed intervals.</li></ul><h3>Stopping Them</h3><p>An important aspect of using setTimeout and setInterval is knowing how to stop them. Let&#39;s explore how you can do this.</p><h3>Stopping setTimeout</h3><p>To stop a setTimeout, you use the clearTimeout() function. When you set a timeout, it returns an identifier. You can use this identifier to clear the timeout if needed.</p><h4>Example</h4><pre>let timeoutId = setTimeout(() =&gt; {<br>  console.log(&quot;This will not run if clearTimeout is called before 3 seconds&quot;);<br>}, 3000);<br><br>clearTimeout(timeoutId); // Stops the setTimeout, so the above code won&#39;t execute</pre><p>In this example, the setTimeout is cleared before it has a chance to execute, so the message will never be logged.</p><h3>Stopping setInterval</h3><p>Similarly, setInterval also returns an identifier that can be used to stop the interval with clearInterval().</p><h4>Example</h4><pre>let intervalId = setInterval(() =&gt; {<br>  console.log(&quot;This will keep running unless clearInterval is called&quot;);<br>}, 2000);<br><br>// To stop the interval, you would call clearInterval<br>clearInterval(intervalId); // Stops the setInterval, so the above code stops executing</pre><p>Here, the interval will keep logging the message every 2 seconds until clearInterval(intervalId) is called. Once it’s called, the repeated execution stops.</p><h3>Practical Considerations</h3><ul><li>Memory and Performance: Be cautious with setInterval. If not stopped properly, it can continue running and may lead to memory leaks and performance issues.</li><li>Timing Control: Both setTimeout and setInterval are not guaranteed to execute precisely at the specified time due to JavaScript&#39;s single-threaded nature. They will execute as soon as possible after the specified delay.</li></ul><h3>When to Use Which</h3><ul><li>Use setTimeout for actions that you want to delay once.</li><li>Use setInterval for actions that need to happen regularly (but be aware of potential memory leaks!).</li></ul><h3>Conclusion</h3><p>Understanding setTimeout and setInterval is crucial for any JavaScript developer. They give you control over timing, which is a powerful tool in your coding arsenal. Remember, with great power comes great responsibility. Use these functions wisely to enhance user experience on your web applications!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f29b5ae2d9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Function Expression vs. Function Declaration in JavaScript: A Deep Dive]]></title>
            <link>https://medium.com/@shahin.kahangi/function-expression-vs-function-declaration-in-javascript-a-deep-dive-19810de49a67?source=rss-e4029ebc27a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/19810de49a67</guid>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Shahin Kahangi]]></dc:creator>
            <pubDate>Thu, 02 Nov 2023 10:42:35 GMT</pubDate>
            <atom:updated>2023-11-02T11:02:28.820Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9reVkOpOpbLDE4yCcINWw.png" /></figure><p>In the dynamic world of JavaScript, understanding the nuances of functions is crucial for writing clean, effective code. Among the foundational concepts are Function Expressions and Function Declarations. At a glance, they might seem interchangeable, but delving deeper, we see distinct characteristics that set them apart.</p><h3>1. Definition</h3><ul><li><strong>Function Declaration</strong> (or Function Statement):</li></ul><pre>function greet() {<br>  console.log(&quot;Hello, World!&quot;);<br>}</pre><ul><li><strong>Function Expression:</strong></li></ul><pre>const greet = function() {<br>  console.log(&quot;Hello, World!&quot;);<br>};</pre><h3>2. Hoisting</h3><ul><li><strong>Function Declaration:</strong> They are hoisted, which means the entire function can be called before it’s defined in the code.</li></ul><pre>greet(); // Outputs: &quot;Hello, World!&quot;<br>function greet() {<br>  console.log(&quot;Hello, World!&quot;);<br>}</pre><ul><li><strong>Function Expression:</strong> Only the variable declaration (not the assignment) is hoisted. Hence, you can’t call the function before its definition.</li></ul><pre>greet(); // TypeError: greet is not a function<br>const greet = function() {<br>  console.log(&quot;Hello, World!&quot;);<br>};</pre><h3>3. Use Cases</h3><ul><li><strong>Function Declaration:</strong> Ideal when you want to define a utility function that’s available throughout your code, regardless of where you define it.</li><li><strong>Function Expression:</strong> Useful when defining functions conditionally, or as callbacks and when passing functions as arguments. It’s also a go-to when defining methods inside objects or classes.</li></ul><h3>4. Benefits and Drawbacks</h3><h4><strong>Function Declaration:</strong></h4><ul><li><strong>Pros:</strong></li></ul><ol><li>Offers more flexibility due to hoisting.</li><li>Easier to locate in code.</li></ol><ul><li><strong>Cons:</strong></li></ul><ol><li>Can lead to confusion if not careful with order.</li></ol><h4><strong>Function Expression:</strong></h4><ul><li><strong>Pros:</strong></li></ul><ol><li>Offers more control over when and how the function is initialized.</li><li>Can be anonymous or named.</li></ol><ul><li><strong>Cons:</strong></li></ul><ol><li>Limited by the variable’s scope.</li><li>Not hoisted, which can lead to errors if not careful.</li></ol><h3>5. Conclusion</h3><p>The choice between function expression and function declaration often boils down to your specific use case. Familiarizing oneself with their distinctions ensures that we harness their strengths effectively, paving the way for clearer, more maintainable JavaScript code. Remember, it’s not about one being better than the other, but rather understanding when to use which.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19810de49a67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Moth in the Machine: Unraveling the Mythical Origin of ‘Debugging’]]></title>
            <link>https://medium.com/@shahin.kahangi/the-moth-in-the-machine-unraveling-the-mythical-origin-of-debugging-830f1cc8fcfd?source=rss-e4029ebc27a4------2</link>
            <guid isPermaLink="false">https://medium.com/p/830f1cc8fcfd</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[history-of-technology]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[grace-hopper]]></category>
            <dc:creator><![CDATA[Shahin Kahangi]]></dc:creator>
            <pubDate>Tue, 31 Oct 2023 12:00:01 GMT</pubDate>
            <atom:updated>2023-10-31T12:00:01.375Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mn2q_nknDW0jeNN9NbbTVA.png" /></figure><p>In the dynamic world of computer science, terms and jargon evolve, often carrying stories that root them in the annals of history. One such term, universally recognized by programmers and tech enthusiasts alike, is “debugging.” At its core, debugging is the meticulous process of finding and resolving defects or problems within a computer program. But have you ever stopped to wonder where this peculiar term originated?</p><p>The story takes us back to a summer evening in 1947 at Harvard University. Nestled within the walls of the Computation Laboratory was the electromechanical behemoth known as the Mark II computer. As World War II had concluded just a couple of years prior, the Mark II was at the forefront of technological advancement, representing the cutting edge of computing capabilities of its time.</p><p>But one day, the Mark II faltered. Its operations were halted, not by a software glitch, not by an operator error, but by a tiny creature of the night — a moth. This unsuspecting insect had made its way into the machine, getting trapped in one of the computer’s relays. As the team scurried to figure out the source of the problem, they stumbled upon the moth, which had become an inadvertent roadblock to their computations.</p><p>Grace Hopper, an indomitable force in the world of computer science and a key figure in the development of the COBOL programming language, was among the team working on the Mark II that fateful day. With a hint of amusement and perhaps a dash of irony, she attached the moth to the computer’s logbook. Documenting the incident, she wrote they were “debugging” the system.</p><p>It’s essential to note that the term “bug,” used to denote a flaw or imperfection, predates this incident. References to “bugs” in machinery can be traced back even to the 19th century. However, this particular event at Harvard, with its tangible and quite literal “bug,” offered a delightful and graphic representation of the term. It’s no surprise that the story, enhanced by Hopper’s stature in the computing world, became legendary in tech circles.</p><p>Today, as software engineers spend countless hours debugging their intricate code, it’s both humorous and humbling to remember that one of the earliest instances of “debugging” involved a real insect and a team of pioneering computer scientists. The next time you find yourself entrenched in debugging, consider the moth, Grace Hopper, and the rich tapestry of stories that underpin the evolution of technology.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=830f1cc8fcfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>