<?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: Muhammad Haseeb Azam</title>
    <description>The latest articles on DEV Community by Muhammad Haseeb Azam (@mohdhaseebazam).</description>
    <link>https://dev.to/mohdhaseebazam</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%2F1152773%2F7ed50115-5b41-4452-af07-934787ecfd38.png</url>
      <title>DEV Community: Muhammad Haseeb Azam</title>
      <link>https://dev.to/mohdhaseebazam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohdhaseebazam"/>
    <language>en</language>
    <item>
      <title>Understanding the Difference Between git pull and git merge in Git</title>
      <dc:creator>Muhammad Haseeb Azam</dc:creator>
      <pubDate>Wed, 01 Nov 2023 21:31:40 +0000</pubDate>
      <link>https://dev.to/mohdhaseebazam/understanding-the-difference-between-git-pull-and-git-merge-in-git-3l8o</link>
      <guid>https://dev.to/mohdhaseebazam/understanding-the-difference-between-git-pull-and-git-merge-in-git-3l8o</guid>
      <description>&lt;p&gt;In Git, the commands git pull and git merge are used to integrate changes from another branch or repository into the current branch. While both commands serve a similar purpose of merging changes, they operate differently and are used in distinct contexts.&lt;/p&gt;

&lt;p&gt;Git Merge&lt;br&gt;
What is git merge?&lt;br&gt;
git merge is a fundamental Git command used to merge changes from one branch into the current working branch. It integrates the changes by creating a new merge commit, which combines the histories of both branches. When you run git merge, you are explicitly specifying the branch from which you want to merge changes.&lt;/p&gt;

&lt;p&gt;How does git merge work?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check out the branch where you want to apply changes.&lt;/li&gt;
&lt;li&gt;Run git merge  to merge changes from the specified branch () into the current branch.&lt;/li&gt;
&lt;li&gt;Git analyzes the commit history to identify a common ancestor and combines the changes to create a new merge commit.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;Merging changes from a feature branch into the main branch (master or main).&lt;/li&gt;
&lt;li&gt;Integrating changes from a remote branch after a successful code review.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Git Pull&lt;br&gt;
What is git pull?&lt;br&gt;
git pull is a higher-level command in Git that fetches changes from a remote repository and integrates those changes into the current branch. It combines two actions: git fetch and git merge. The git pull command not only retrieves changes from the remote repository but also automatically merges those changes into the local branch.&lt;/p&gt;

&lt;p&gt;How does git pull work?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;git pull triggers a git fetch to retrieve changes from the remote repository, updating the remote tracking branch (e.g., origin/master).&lt;/li&gt;
&lt;li&gt;It then performs a git merge (by default) to merge the changes from the remote tracking branch into the local branch.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;Keeping the local branch up-to-date with changes from a shared remote repository.&lt;/li&gt;
&lt;li&gt;Fetching and integrating changes from a shared repository before making local modifications.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key Differences&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Level of Automation:&lt;br&gt;
git merge requires you to specify the branch you want to merge. It's a manual process that gives you more control over the merging operation.&lt;br&gt;
git pull automates the process of fetching and merging changes from a remote repository. It's convenient for staying updated with remote changes but offers less control over the merging process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Operation:&lt;br&gt;
git merge operates locally and merges change within the local repository.&lt;br&gt;
git pull involves both local and remote operations by fetching and merging remote changes into the local branch.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Conclusion&lt;br&gt;
Understanding the differences between git merge and git pull is crucial in effective version control management. git merge is primarily used for merging changes between branches within the local repository, providing more control over the merging process. On the other hand, git pull simplifies the process of fetching and integrating changes from a remote repository, making it convenient for collaboration but offering less control over the merge.&lt;/p&gt;

&lt;p&gt;It's essential to choose the right command based on the specific workflow and the desired level of control when integrating changes in Git.&lt;/p&gt;

</description>
      <category>git</category>
      <category>versioncontrol</category>
    </item>
    <item>
      <title>Exploring the Distinctions: forEach vs. map in JavaScript Arrays</title>
      <dc:creator>Muhammad Haseeb Azam</dc:creator>
      <pubDate>Fri, 08 Sep 2023 19:46:57 +0000</pubDate>
      <link>https://dev.to/mohdhaseebazam/exploring-the-distinctions-foreach-vs-map-in-javascript-arrays-kp8</link>
      <guid>https://dev.to/mohdhaseebazam/exploring-the-distinctions-foreach-vs-map-in-javascript-arrays-kp8</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SYFOINTy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjwzpr4t8f7hfgovfhs4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SYFOINTy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjwzpr4t8f7hfgovfhs4.jpg" alt="javascript image" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;JavaScript, as a versatile and powerful programming language, offers several methods for working with arrays. Two of the most commonly used iteration methods are &lt;strong&gt;forEach&lt;/strong&gt; and &lt;strong&gt;map&lt;/strong&gt;. These functions serve as essential tools for developers when it comes to manipulating and processing arrays efficiently.&lt;/p&gt;

&lt;p&gt;In this article, we will dive into the world of &lt;strong&gt;forEach&lt;/strong&gt; and &lt;strong&gt;map&lt;/strong&gt;, exploring their differences, use cases, and how they can help you streamline your array operations. Whether you're a seasoned developer looking to sharpen your skills or a newcomer eager to harness the full potential of JavaScript arrays, understanding the nuances of &lt;strong&gt;forEach&lt;/strong&gt; and &lt;strong&gt;map&lt;/strong&gt; is crucial.&lt;/p&gt;

&lt;p&gt;Let’s embark on this journey to uncover the unique characteristics of these loop functions and discover when to employ each one to achieve your programming goals. Whether you aim to transform array elements or simply perform actions on them, by the end of this article, you’ll have a clear understanding of how &lt;strong&gt;forEach&lt;/strong&gt; and &lt;strong&gt;map&lt;/strong&gt; can be your allies in array manipulation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Purpose&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;forEach&lt;/strong&gt;: The primary purpose of &lt;strong&gt;forEach&lt;/strong&gt; is to iterate over the elements of an array and perform a specified action or operation on each element &lt;strong&gt;without creating a new array&lt;/strong&gt;. It's ideal for side effects like logging, updating values, or performing actions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;map&lt;/strong&gt;: &lt;strong&gt;map&lt;/strong&gt;, on the other hand, is designed to iterate over an array, apply a provided function to each element, and create a new array with the results of those function calls. Its primary use case is &lt;strong&gt;transforming array elements&lt;/strong&gt; and &lt;strong&gt;generating a new array&lt;/strong&gt; based on those transformations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Return Value:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;forEach&lt;/strong&gt;: &lt;strong&gt;forEach&lt;/strong&gt; always returns &lt;strong&gt;undefined&lt;/strong&gt;. It does not produce a new array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;map&lt;/strong&gt;: &lt;strong&gt;map&lt;/strong&gt; &lt;strong&gt;returns a new array&lt;/strong&gt; with the same length as the original array, where each element is the result of applying the provided function to the corresponding element in the original array.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Use Cases:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;forEach&lt;/strong&gt;: Use &lt;strong&gt;forEach&lt;/strong&gt; when you need to iterate over an array to perform actions or side effects on its elements. For instance, you might use it for logging, updating elements in place, or triggering some other function for each item in the array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;map&lt;/strong&gt;: Use &lt;strong&gt;map&lt;/strong&gt; when you want to &lt;strong&gt;transform the elements&lt;/strong&gt; of an array and &lt;strong&gt;create a new array with the transformed values&lt;/strong&gt;. This is useful when you need to maintain the original array intact and produce a modified copy of it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Examples:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;forEach:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QNNkrSIv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2qfkvlir9totlb27g2i0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QNNkrSIv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2qfkvlir9totlb27g2i0.png" alt="forEach example" width="800" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;map:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y2n1cdba--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19nj1e2bdsks74r6whnw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y2n1cdba--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19nj1e2bdsks74r6whnw.png" alt="map example" width="800" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>arrays</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
